教你在Linux系统Supervisor在管理进程

时间:2015-05-15237举报小编:123

使用Linux的小伙伴们,对超级用户Supervisor肯定不会陌生,我们可以通过Supervisor对电脑上所有的文件卷宗、目录和文件进行管理,今天我就给大家介绍一个Supervisor进程管理吧。快来看看吧。


功能

优点

配置简单

管理精准

进程组管理

RPC扩展

API支持

FastCGI进程管理

事件支持(如定时任务)

缺点

被管理进程必须前台运行

退出后会使被监管的进程也退出

配置

[unix_http_server]

file=/var/run/supervisor.sock

chmod=0700

[supervisord]

logfile=/var/log/supervisor/supervisord.log

pidfile=/var/run/supervisord.pid

childlogdir=/var/log/supervisor

[rpcinterface:supervisor]

supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]

serverurl=unix:///var/run/supervisor.sock

[program:cow]

command=/web/root/bin/cow -rc="/web/root/etc/cow.conf"

autostart=true

autorestart=true

redirect_stderr=true

stderr_logfile=NONE

[include]

files = /etc/supervisor/conf.d/*.conf

操作

supervisorctl status 查看进程状态

supervisorctl reload 重启supervisord

supervisorctl start|stop|restart 启动关闭重启进程

以上就是Linux系统的一个Supervisor进程管理了,对Supervisor感兴趣的用户,可以在自己的电脑上尝试下这个进程管理。