How do I read a pid file in cfengine 3 and restart that process if it isn't running?
Tell me more
×
Server Fault is a question and answer site for
professional system and network administrators. It's 100% free, no registration required.
|
In cfengine 2, I used something like:
In cfengine 3, restarting of processes must be coded as a separate commands.
This will define the class "start_httpd" if httpd is not running. Then will run the init script to make sure it starts. See the cf3 reference manual for a deeper explanation of how the restart_class works. |
|||
|
|
|
Instead of looking at the PID file directly, I'd try to let Cfengine 3 manage your selected service/process. For Cfengine 3 you can use the following code (it might not be perfect, but it works):
Please note that I wrote this Cfengine 3 script for an Ubuntu client, so you might have to adopt it to your needs and distribution. |
|||
|
|