svscan
is a program in the daemontools
package. The program starts instances of
supervise
and restarts them when they die. The scripts to start the applications are stored in /service.[root@mail FAMS_MON_952]# pwd
/service/FAMS_MON_952
[root@mail FAMS_MON_952]# ls
run supervise
[root@mail FAMS_MON_952]# cat run
#!/bin/sh
exec /var/fams_mon/fams_svr_monitor -c /var/fams_mon/fams_mon_952.conf
Instance is monitored by daemontool. The run will be called when the instance die
[root@mail FAMS_MON_952]# ps -ef | grep fams_svr_monitor
root 10189 32234 0 14:42 ? 00:00:00 /var/fams_mon/fams_svr_monitor -c /var/fams_mon/fams_mon_952.conf
[root@mail FAMS_MON_952]# kill -9 10189
The /service/FAMS_MON_952/run is called to restart the instance
[root@mail FAMS_MON_952]# ps -ef | grep fams_svr_monitor
root 12033 32234 0 14:44 ? 00:00:00 /var/fams_mon/fams_svr_monitor -c /var/fams_mon/fams_mon_952.conf
HOW TO STOP THE INSTANCE?
1> rename the /service/FAMS_MON_952/run to /service/FAMS_MON_952/run.bak
2> kill the instance
/etc/inittab
Put the lineSV:12345:respawn:/command/svscanbootat the end of /etc/inittab.