Supervisord
Supervisord 執行 ssserver 但在 CentOS 上報錯?
我有以下 Supervisord 設置
/etc/supervisord.conf
:... [program:shadowsocks] command=ssserver -c ~/config.json autorestart=true user=nobody ...
/etc/rc.d/init.d/supervisord
:#!/bin/sh # # /etc/rc.d/init.d/supervisord # # Supervisor is a client/server system that # allows its users to monitor and control a # number of processes on UNIX-like operating # systems. # # chkconfig: - 64 36 # description: Supervisor Server # processname: supervisord # Source init functions . /etc/rc.d/init.d/functions prog="supervisord" prefix="/usr/" exec_prefix="${prefix}" prog_bin="${exec_prefix}/bin/supervisord" PIDFILE="/var/run/$prog.pid" start() { echo -n $"Starting $prog: " daemon $prog_bin --pidfile $PIDFILE [ -f $PIDFILE ] && success $"$prog startup" || failure $"$prog startup" echo } stop() { echo -n $"Shutting down $prog: " [ -f $PIDFILE ] && killproc $prog || success $"$prog shutdown" echo } case "$1" in start) start ;; stop) stop ;; status) status $prog ;; restart) stop start ;; *) echo "Usage: $0 {start|stop|restart|status}" ;; esac
然後我執行以下操作來設置並啟動它:
$ sudo chmod +x /etc/rc.d/init.d/supervisord $ sudo chkconfig --add supervisord $ sudo chkconfig supervisord on $ sudo service supervisord start
之後一切正常。現在當我開始時
shadowsocks
:supervisorctl start shadowsocks
它報告一個錯誤:
shadowsocks: ERROR (abnormal termination)
但是,如果我直接執行:
ssserver -c ~/config.json
它運作良好。為什麼這不起作用
supervisord
?
supervisor
不支持 tidle~
擴展的AFAIK~/config.json
被視為文字。您應該更改
~/config.json
為它的絕對路徑/path/to/config.json
並確保它可以被nobody
.有關主管配置的更多資訊,請參見此處。