Tools: Daemontools
Daemontools is a set of UNIX service Administration tools developed by QMail's author DJB, where a program named supervise can be used for service startup, stop service restart, and so on.
Installation:
Create A/package Directory:
Mkdir-p/package
chmod 1755/package
Cd/package
Download http://cr.yp.to/daemontools/daemontools-0.76.tar.gz Into/package. Unpack the Daemontools package:
Gunzip Daemontools-0.76.tar
TAR-XPF Daemontools-0.76.tar
Rm-f Daemontools-0.76.tar
CD admin/daemontools-0.76
Compile and set up the Daemontools programs:
Package/install
Test whether the installation was successful:
# Ps-ef | grep Svscan
# Mans Svscan
Use the supervise program for program management monitoring, take memcache as an example, Memcache directory is in/usr/local/memcache
Create a new corner in the Memcache directory this file
#vim Run
The contents are as follows
#!/bin/sh
EXEC 2>&1
Exec/usr/local/memcache/bin-u root-d
Run:
Supervise/usr/local/memcache
Verify that the monitoring memcache is successful:
kill-9 [memcached PID]---kill the process
Ps-aux|grep memcached----View process
To view the process, if there is a memcached process "just different than the previous PID", the automatic reboot is successful.