安装
sudo apt-get install supervisor
启动,否则会报 unix:///tmp/supervisor.sock no such file
service supervisor start
supervisord -c /etc/supervisord.conf
查看状态
supervisorctl status #查看supervisorctl状态 supervisorctl start openfalcon #启动子进程 supervisorctl stop openfalcon #关闭子进程 supervisorctl restart openfalcon #重启子进程
比如
[email protected]:~$ supervisorctl status openfalcon RUNNING pid 10759, uptime 0:18:46
配置文件在 /etc/supervisor 目录下
[email protected]:/etc/supervisor$ ls conf.d start_openfalcon.conf supervisord.conf
内容
[program:openfalcon] command = cd ~/software/open-falcon-v0.2.1 & open-falcon start user = lintong autostart = true autoresart = true stderr_logfile = /var/log/supervisor/openfalcon.stderr.log stdout_logfile = /var/log/supervisor/openfalcon.stdout.log
重新加载配置
supervisorctl reload
更新配置
supervisorctl update
web界面,账号密码参考 /etc/supervisord.conf
localhost:9001
原文地址:https://www.cnblogs.com/tonglin0325/p/11483918.html
时间: 2024-10-24 06:15:46