Supervisordはssserverを実行しますが、CentOSでエラーを報告しますか?

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

ベストアンサー1

AFAIK、supervisorタイトル~拡張はサポートされておらず、~/config.jsonテキストとして扱われます。

~/config.json絶対パスを変更して/path/to/config.json通過可能であることを確認する必要がありますnobody

スーパーバイザの設定の詳細については、次を参照してください。ここ

おすすめ記事