apk update
apk add supervisor nano
touch /etc/local.d/supervisor.start
#在/etc/local.d/里添加supervisor.start内容如下
nohup /usr/bin/supervisord -c /etc/supervisord.conf >> /dev/null
#然后
chmod +x /etc/local.d/supervisor.start
rc-update add local
#编辑/etc/supervisord.conf
nano /etc/supervisord.conf
#添加
[inet_http_server]
port=0.0.0.0:54321
username=root
password=12345
[program:xray]
command=/root/xray/xray run -config /root/xray/config_server.json
directory=/root/xray
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/xray.log
如果无法启动,应该是log文件创建失败,/var/log/supervisor/xray.log,先创建/var/log/supervisor,再创建xray.log
alpine使用supervisor开机自动启动程序
未经允许不得转载:家里蹲的狐狸 » alpine使用supervisor开机自动启动程序