I’ve really been getting into cfengine lately to manage configurations across multiple servers.
One thing I want to do is to make sure that the proper services are started. Making sure they’re running is easy with the processes command:
1 2 |
|
I also want to make sure that cfenvd is in the startup scripts. My solution earlier was
1 2 |
|
Which worked, but was run every time and generated unnecessary emails.
I tried some variants of
1 2 |
|
but for some reason the pipe causes problems.
Reading through the chkconfig man page, I see that a simple “chkconfig cfenvd” will return 0 if the service is started in the current runlevel, and 1 otherwise. Thus:
1 2 3 4 5 |
|