cron job for Linux servers to restart cf-execd when it dies

100 views
Skip to first unread message

Aleksey Tsalolikhin

unread,
Jun 25, 2015, 5:41:28 PM6/25/15
to help-c...@googlegroups.com
Hi,

This is the cron job I use to make sure I always have CFEngine running.  cf-execd process may die (like any daemon), and the following cron job, run once every five minutes, will bring it back up if the /etc/init.d/cfengine3 script is executable. 

[ -x /etc/init.d/cfengine3 ] && if ! pgrep cf-execd > /dev/null ; then /etc/init.d/cfengine3 restart >/dev/null ; fi # keep cfengine3 service running. If you want to turn off CFEngine, run: chmod -x /etc/init.d/cfengine3 && /etc/init.d/cfengine 3 stop


I haven't tested this on anything but RHEL.

Best,
-at

--
Need CFEngine training?  Email trai...@verticalsysadmin.com

Jason Tucker

unread,
Jun 25, 2015, 9:23:02 PM6/25/15
to help-c...@googlegroups.com
I think the thing I miss most after years of Solaris administration and moving to Linux is SMF. It completely eliminated the need for things like this. And I haven't quite worked up the nerve to venture into systemd-land yet, myself, but going back to cron jobs to ensure services being up feels (to me) much like getting rid of the automobile and going back to a horse and carriage :-)

I don't mean to sound negative on your solution, though, don't get me wrong - I'm just feeling nostalgic :-) Hopefully, some will find it useful, thanks for sharing!

__Jason

Aleksey Tsalolikhin

unread,
Jun 26, 2015, 10:43:36 AM6/26/15
to Jason Tucker, help-c...@googlegroups.com
After talking to Brian and now you, I'm starting to get nostalgic. I got my professional start on Solaris.  I remember being amazed at dynamic reconfiguration -- ability to migrate processes of a RAM/CPU board in a mid-range server, power off that board only, replace it while the server is live, and then power it back on and migrate processes back onto it -- back in 2001.  Advanced technology!

Thanks, Jason.  :)

Aleksey Tsalolikhin

--
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.

Martin Simons

unread,
Jun 27, 2015, 9:21:43 AM6/27/15
to help-c...@googlegroups.com
Dear Aleksey,

Normation have a nice policy for this one IMHO.

Op donderdag 25 juni 2015 23:41:28 UTC+2 schreef atsaloli.tech:

Patrick de Ruiter

unread,
Jun 28, 2015, 3:59:24 AM6/28/15
to help-c...@googlegroups.com
Hi Martin,

You can write policy code al you want, but if CFEngine isn't running it cant promise anything.
That sounds like A false promise to me ;-)

Cheers,
Patrick

Reply all
Reply to author
Forward
0 new messages