日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

supervisor开机自启动方法

發(fā)布時間:2023/12/18 编程问答 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 supervisor开机自启动方法 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

配置service類型服務(wù)

1 #!/bin/bash 2 # 3 # supervisord This scripts turns supervisord on 4 # 5 # Author: Mike McGrath <mmcgrath@redhat.com> (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 "/usr/local/bin/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

?

將上述腳本內(nèi)容保存到/etc/rc.d/init.d/supervisor文件中,修改文件權(quán)限為755,并設(shè)置開機啟動

chmod 755 /etc/rc.d/init.d/supervisor chkconfig supervisor on

注意:修改腳本中supervisor配置文件路徑為你的supervisor的配置文件路徑

Supervisor只能管理非daemon的進程,也就是說Supervisor不能管理守護進程。否則提示Exited too quickly (process log may have details)異常。例子中的Tomcat默認是以守護進程啟動的,所以我們改成了catalina.sh run,以前臺進程的方式運行

來源:http://blog.csdn.net/xyang81/article/details/51555473

轉(zhuǎn)載于:https://www.cnblogs.com/shengulong/p/7641069.html

總結(jié)

以上是生活随笔為你收集整理的supervisor开机自启动方法的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。