please take a look what I'm doing, I just want to get the PIDs of the three cfengine processes:
=)I need to restart all cf-serverds.. and for QAing it I want to grep all PIDs in advance =)[small tasks to get familiar with CFEngine]
You are restarting cf-serverd because you are running an older version that does not automatically read in the new config, right?
I would recommend writing a promise that signals cf-serverd if the config files have been updated within the past 15 minutes. So you'll need to set a class if the config files mtime < 15 minutes.
You can just watch the cf-serverd restart, you don't need to put it in policy.
Once you see it works, you'll trust CFEngine more and yourself as a CFEngine policy writer.
I should mention cf-execd will restart cf-serverd if you manage to kill it.
configOlderThan15Mins::then what? SIGHUP? Can't find how to do it after an hr research..
--
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to help-cfengin...@googlegroups.com.
To post to this group, send email to help-c...@googlegroups.com.
Visit this group at http://groups.google.com/group/help-cfengine.
For more options, visit https://groups.google.com/d/optout.
THIS WORKS!!! GREAT!!!
But I want to kill cf-execd and cf-monitord as well and find no way. All examples just send a signal to one process.I know that the cfengine processes can be killed in a different way. Then think about 3 whatever processes "p1", "p2" and "p3".How do I get them in one run?
bundle agent example { | |
processes: | |
"cupsd" | |
handle => "shutdown_print_services", | |
comment => "Shutdown print services on machines | |
that are not print servers", | |
process_stop => "/etc/init.d/cups stop"; | |
} |
--
You received this message because you are subscribed to the Google Groups "help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to help-cfengin...@googlegroups.com.
To post to this group, send email to help-c...@googlegroups.com.
Visit this group at http://groups.google.com/group/help-cfengine.
For more options, visit https://groups.google.com/d/optout.
[root@host001]# cf-agent -KIf /var/cfengine/inputs/R4Promises/killProcesses.cf
2015-09-02T14:25:31+0000 info: /default/killProcesses/processes/'cf-serverd'[0]: Signalled 'term' (15) to process 3881 (root 3881 1 3881 0.0 5.1 39568 0 5940 1 14:25 00:16 00:00:00 /var/cfengine/bin/cf-serverd)
2015-09-02T14:25:31+0000 info: /default/killProcesses/processes/'cf-serverd'[0]: Signalled 'kill' (9) to process 3881 (root 3881 1 3881 0.0 5.1 39568 0 5940 1 14:25 00:16 00:00:00 /var/cfengine/bin/cf-serverd)
2015-09-02T14:25:31+0000 info: /default/killProcesses/processes/'cf-monitord'[1]: Signalled 'term' (15) to process 3890 (root 3890 1 3890 0.3 6.1 39488 0 7096 1 14:25 00:15 00:00:00 /var/cfengine/bin/cf-monitord)
2015-09-02T14:25:31+0000 error: /default/killProcesses/processes/'cf-monitord'[1]: Couldn't send promised signal 'kill' (9) to pid 3890 (might be dead). (kill: No such process)
2015-09-02T14:25:31+0000 info: /default/killProcesses/processes/'cf-execd'[2]: Signalled 'term' (15) to process 3872 (root 3872 1 3872 0.0 2.8 35988 0 3288 1 14:25 00:16 00:00:00 /var/cfengine/bin/cf-execd)
2015-09-02T14:25:31+0000 info: /default/killProcesses/processes/'cf-execd'[2]: Signalled 'kill' (9) to process 3872 (root 3872 1 3872 0.0 2.8 35988 0 3288 1 14:25 00:16 00:00:00 /var/cfengine/bin/cf-execd)
[root@host001]#
Is there no test if the term succeeded?
Best,
Chris