分享页面

Centos7.6如何配置使用supervisor设置进程守护

发布时间:2023-09-19 09:47

1.输入该命令按回车键:vi /etc/supervisord.conf

img

2.按“i”进入插入模式,找到inet_http_server,将注释去掉

img

img

3.找到include,将注释去掉,设置ini文件的保存目录,修改完成后按ESC键输入wq按回车键保存退出vi编辑

img

img

4.输入该命令按回车键:mkdir /etc/supervisor

img

5.输入该命令按回车键:mkdir /etc/supervisor/config.d

img

6.输入该命令按回车键:cd /etc/supervisor/config.d

img

7.输入该命令按回车键:vi test.ini

img

8.按i进入插入模式,参考以下方式设置,command为指定程序路径,修改完成后按ESC键输入wq按回车键保存退出vi编辑

  1. [program:test]
  2. command=/root/apache-tomcat-9.0.80/bin/startup.sh
  3. user=root
  4. autostart=true
  5. autorestart=true
  6. stderr_logfile=/root/test.err.log
  7. stdout_logfile=/root/test.out.log

img

9.输入该命令按回车键:supervisord -c /etc/supervisord.conf

img

本文导读