[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: matches=0 still triggers action
From: |
Sven Mueller |
Subject: |
Re: matches=0 still triggers action |
Date: |
Tue, 02 Nov 2004 15:52:45 +0100 |
User-agent: |
Thunderbird 0.7.3 (Windows/20040803) |
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