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: Ed Brown
Subject: Re: using 'processes:' to stop processes
Date: Fri, 10 Dec 2004 09:18:10 -0700

David,

Thanks for the info.  I didn't try it with 'matches=' or 'action='
options.  I've changed to just 'matches=0', instead of the phony restart
command, because its cleaner, though both have the same effect (the
class is defined if the process is running).

-Ed  


On Thu, 2004-12-09 at 18:40, David E. Nelson wrote:
> 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
> > address@hidden
> > http://lists.gnu.org/mailman/listinfo/help-cfengine
> >





reply via email to

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