Linux.com

Home Linux Community Forums Linux Distributions Red Hat Script to auto restart a service in linux

Script to auto restart a service in linux

Link to this post 06 Mar 10

I wouldn't rely on the pid file. I've had services die unexpectedly and leave pid files and lock files behind.

I would write a script that checks the output of ps for the presence of and state of the application, and then kick off the init script if it's missing, and kill and then restart it if it got zombied somehow.

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board