Here is an excerpt from an exchange last year about this:
-----------------------
On Wed, 2005-01-05 at 06:34, Christian Pearce wrote:
> cfagent.conf
> control:
> actionsequence = ( copy shellcommands shellcommands.secondrun )
In my experience, if you qualify any action, you had better qualify them
all. The above is misleading in that if you move the unqualified
'shellcommands' after 'shellcommands.secondrun' it does not change the
actionsequence. In other words, this does not work:
actionsequence = ( shellcommands.firstrun shellcommands )
-----------------------
So, you CAN get away with using an unqualified actionsequence item
before, but not after, a qualified instance. The unqualified actions
will run at the same time in the sequence as the qualified ones (and
not again later, because of locking - you should be able to verify
this in the output, no?)
-Ed
Brian E. Seppanen wrote:
I have the following pseudocode
actionsequence = ( processes.pre copy directories links files
editfiles packages tidy shellcommands processes )
AddInstallables = ( "servicesremove" )
shellcommands:
servicesremove::
"/usr/bin/env PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin
/usr/sbin/update-rc.d -f atd remove"
processes:
pre.debian::
"atd" action=warn matches>0 define=servicesremove
debian.!pre::
"atd" signal=term
I get the following output
*********************************************************************
Main Tree Sched: processes.pre pass 1 @ Wed Apr 19 11:51:41 2006
*********************************************************************
New temporary class additions
--------( Pass 1 )-------
pre
cfengine:sibelius: Running process command /bin/ps auxw
cfengine:sibelius: Process alert: USER PID %CPU %MEM VSZ RSS
TTY STAT START TIME COMMAND
cfengine:sibelius: Process alert: daemon 13436 0.0 0.1 1764 632 ?
Ss 11:51 0:00 /usr/sbin/atd
Defining classes servicesremove
DoSignals(atd)
*********************************************************************
Main Tree Sched: shellcommands pass 1 @ Wed Apr 19 11:51:41 2006
*********************************************************************
*********************************************************************
Main Tree Sched: processes pass 1 @ Wed Apr 19 11:51:41 2006
*********************************************************************
cfengine:sibelius: Running process command /bin/ps auxw
cfengine:sibelius: Signalled process 13436 (atd) with SIGTERM
cfengine:sibelius: Killed: daemon 13436 0.0 0.1 1764 632 ?
Ss 11:51 0:00 /usr/sbin/atd
Defining classes
DoSignals(atd)
---------------------------------------------------------------------
Why doesn't servicesremove trigger the shellcommand defined under group
servicesremove. Am I insane? I've fought with this forever and
asked about this earlier, I just assumed I was doing something wrong.
I can't figure out what it would be.
This is happening on 2.1.20 and has happened when I was using 2.1.13.
Brian Seppanen
608.826.1464
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
http://cfengine.org/mailman/listinfo/help-cfengine
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
http://cfengine.org/mailman/listinfo/help-cfengine