help-cfengine
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using 'processes:' to stop processes


From: David E. Nelson
Subject: Re: using 'processes:' to stop processes
Date: Thu, 9 Dec 2004 19:40:00 -0600 (CST)


Hi Ed,

I believe I was one of the 'matches=0 still triggers action' contributors and the solution provided does not require a phony 'restart'. I'm successfully using:

processes:
    solaris::
        "lpsched$"
            matches=0
            action=bymatch
            define=solaris_lpsched_stop

shellcommands:
    solaris_lpsched_stop::
        "/etc/init.d/lp stop"

Aesthetically, I like the idea of having something in 'processes' to care of all this in one place.

Regards,
         /\/elson


On Thu, 9 Dec 2004, Ed Brown wrote:

This has come up before, obliquely at least, in a couple of threads
("Re: matches=0 still triggers action", and "Re: Killed wrong proc!"),
but I'd like to raise the issue again to restate an aspect of it that I
don't think has been made clear, and to keep the issue or need for a
solution alive.

There is no simple way to use 'processes:' to kill processes that
shouldn't be running, when 'signal=' is not the right tool for the job.
A previous suggestion was to add support for 'services', or the init
scripts start/stop functionality directly.

I think that what's needed, and would be preferable in my view (and
maybe simpler to implement?), is just to be able to define a
shellcommand string to execute when a process IS running, in exactly the
same way that the 'restart' string is executed when a process isn't
running. This would allow for similiar flexibility as exists with
'restart', for example, removing start links (chkconfig) AND stopping
the service.

An earlier suggested workaround is use 'processes:' to define a class,
and then use a qualified 'shellcommands:' action.  This works, except
that it is necessary to also declare a phony 'restart' command
(/bin/true or /bin/false both work fine).  Without the restart command,
no define= or elsedefine= options are processed.  All in all, this is
somewhat kludgy, and it just seems intuitive to expect to be able to
handle all this within 'processes:'.

thanks,
Ed


On Tue, 2004-11-02 at 10:04, Brendan Strejcek wrote:
David E. Nelson wrote:
I still don't have a clear idea of how to stop 'lpsched' since
/etc/init.d/lp uses 'lpshut' rather than signalling 'lpsched' to die.
Since the OS designers specifically use 'lpshut' (and it's not a
script that simply kills either) to stop 'lpsched' and its friends (if
any), I'd rather use that method rather than kill. Ideas?
define=someclass in the process stanza, and a shellcommands action
triggered by someclass:: maybe?






_______________________________________________
Help-cfengine mailing list
Help-cfengine@gnu.org
http://lists.gnu.org/mailman/listinfo/help-cfengine


--
~~ ** ~~  If you didn't learn anything when you broke it the 1st ~~ ** ~~
                        time, then break it again.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]