1. 程式人生 > >supervisor開機自啟動方法

supervisor開機自啟動方法

kcon load tail opp lock scrip eat 開機自啟動 bash

配置service類型服務

 1 #!/bin/bash
 2 #
 3 # supervisord   This scripts turns supervisord on
 4 #
 5 # Author:       Mike McGrath <[email protected]> (based off yumupdatesd)
 6 #
 7 # chkconfig:    - 95 04
 8 #
 9 # description:  supervisor is a process control utility.  It has a web based
10 #               xmlrpc interface as well as a few other nifty features.
11 # processname: supervisord 12 # config: /etc/supervisor/supervisord.conf 13 # pidfile: /var/run/supervisord.pid 14 # 15 16 # source function library 17 . /etc/rc.d/init.d/functions 18 19 RETVAL=0 20 21 start() { 22 echo -n $"Starting supervisord: " 23 daemon "supervisord -c /etc/supervisor/supervisord.conf
" 24 RETVAL=$? 25 echo 26 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/supervisord 27 } 28 29 stop() { 30 echo -n $"Stopping supervisord: " 31 killproc supervisord 32 echo 33 [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/supervisord 34 } 35 36 restart() { 37 stop
38 start 39 } 40 41 case "$1" in 42 start) 43 start 44 ;; 45 stop) 46 stop 47 ;; 48 restart|force-reload|reload) 49 restart 50 ;; 51 condrestart) 52 [ -f /var/lock/subsys/supervisord ] && restart 53 ;; 54 status) 55 status supervisord 56 RETVAL=$? 57 ;; 58 *) 59 echo $"Usage: $0 {start|stop|status|restart|reload|force-reload|condrestart}" 60 exit 1 61 esac 62 63 exit $RETVAL

參考:

1、http://blog.csdn.net/xyang81/article/details/51555473

supervisor開機自啟動方法