天天看点

supervisor 管理进程

        Supervisor( http://supervisord.org/ )是用 Python 开发的一个client/server服务,是Linux/Unix系统下的一个进程管理工具,不支持Windows系统。它可以很方便的监听、启动、停止、重启一个或多个进程。用Supervisor管理的进程,当一个进程意外被杀死,supervisort监听到进程死后,会自动将它重新拉起,很方便的做到进程自动恢复的功能,不再需要自己写shell脚本来控制。

Docker中使用supervisor管理开机自启动(redis && sshd)

dockerfile:

RUN yum -y install python-setuptools

RUN easy_install supervisor

ADD supervisord.conf /etc/supervisord.conf       

EXPOSE 12007   

CMD /usr/bin/supervisord -c /etc/supervisord.conf

开启启动配置supervisord.conf:

supervisor 管理进程

supervisord.conf 文件内容