help-cfengine
[Top][All Lists]
Advanced

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

Re: matches=0 still triggers action


From: David E. Nelson
Subject: Re: matches=0 still triggers action
Date: Tue, 2 Nov 2004 10:55:21 -0600 (CST)


Hi Sven,

Ok, I read over the section - I understand now.

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?

Thanks,
         /\/elson



On Tue, 2 Nov 2004, Sven Mueller wrote:

David E. Nelson [u] wrote on 02/11/2004 14:57:
Hi All,

I've the following stanza in my cfengine-2.1.10 cfagent.conf file:

solaris.externalnets::

         "lpsched$" # External systems do not run print services
             matches=0
             action=bymatch
             restart "/etc/init.d/lp stop"

and even though 'lpsched' is not running, cfengine still attempts to stop printing services.

That's exactly what you are telling cfengine to do. "restart" is executed whenever the number of processes is either 0 or you sent a sigkill or sigterm to the process(es) via the signal option. Don't use it to stop a process.

What you are trying to do is probably this:

solaris.externalnets::
        "lpsched$"
        matches=0 # warn if a process was found
        signal=kill # it shouldn't be running at all,
                    # so the "hard" kill is OK.
        action=signal # the default, anyway: Send signal
                     # action=warn wouldn't send a signal.
        # if you list the "restart" option here, cfengine would
       # do the following three things on each run:
       # 1) warn if at least one process was found running
        # 2) kill any running process
        # 3) run whichever command you specify in the "restart"
        #    option

Read the doc about the processes section again ;-)

cu,
sven


_______________________________________________
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]