Supervisor 是一个客户端服务器系统,允许用户监控和控制类 Unix 操作系统上的进程数。

官网 http://supervisord.org

安装
1. easy_install supervisor
2.
setuptools (latest) from http://pypi.python.org/pypi/setuptools.
meld3 (latest) from http://www.plope.com/software/meld3/.
elementtree (latest) from http://effbot.org/downloads#elementtree.

建立配置文件
echo_supervisord_conf > /etc/supervisord.conf
指定配置文件
supervisord -c supervisord.conf

查找配置文件路经
-c 指定配置文件
无指定配置文件时,查找顺序:
1 $CWD/supervisord.conf
2 $CWD/etc/supervisord.conf
3 /etc/supervisord.conf

配置文件说明

HTTP/XML-RPC 相关配置
[unix_http_server]
file = /tmp/supervisor.sock
chmod = 0777
chown= nobody:nogroup
username = user
password = 123

Web管理界面配置
[inet_http_server]
port = 127.0.0.1:9001
username = user
password = 123

[supervisorctl]
serverurl = unix:///tmp/supervisor.sock 和[unix_http_server]匹配
username = chris
password = 123
prompt = mysupervisor

日志 环境等配置
[supervisord]
logfile = /tmp/supervisord.log
logfile_maxbytes = 50MB
logfile_backups=10
loglevel = info
pidfile = /tmp/supervisord.pid
nodaemon = false
minfds = 1024
minprocs = 200
umask = 022
user = chrism
identifier = supervisor
directory = /tmp
nocleanup = true
childlogdir = /tmp
strip_ansi = false
environment = KEY1="value1",KEY2="value2"

配置单个进程
[program:theprogramname]
command=/bin/cat ; the program (relative uses PATH, can take args)
process_name=%(program_name)s ; process_name expr (default %(program_name)s)
numprocs=1 ; number of processes copies to start (def 1)
directory=/tmp ; directory to cwd to before exec (def no cwd)
umask=022 ; umask for process (default None)
priority=999 ; the relative start priority (default 999)
autostart=true ; start at supervisord start (default: true)
autorestart=unexpected ; whether/when to restart (default: unexpected)
startsecs=1 ; number of secs prog must stay running (def. 1)
startretries=3 ; max # of serial start failures (default 3)
exitcodes=0,2 ; 'expected' exit codes for process (default 0,2)
stopsignal=QUIT ; signal used to kill process (default TERM)
stopwaitsecs=10 ; max num secs to wait b4 SIGKILL (default 10)
stopasgroup=false ; send stop signal to the UNIX process group (default false)
killasgroup=false ; SIGKILL the UNIX process group (def false)
user=chrism ; setuid to this UNIX account to run the program
redirect_stderr=true ; redirect proc stderr to stdout (default false)
stdout_logfile=/a/path ; stdout log path, NONE for none; default AUTO
stdout_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
stdout_logfile_backups=10 ; # of stdout logfile backups (default 10)
stdout_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0)
stdout_events_enabled=false ; emit events on stdout writes (default false)
stderr_logfile=/a/path ; stderr log path, NONE for none; default AUTO
stderr_logfile_maxbytes=1MB ; max # logfile bytes b4 rotation (default 50MB)
stderr_logfile_backups=10 ; # of stderr logfile backups (default 10)
stderr_capture_maxbytes=1MB ; number of bytes in 'capturemode' (default 0)
stderr_events_enabled=false ; emit events on stderr writes (default false)
environment=A="1",B="2" ; process environment additions (def no adds)
serverurl=AUTO ; override serverurl computation (childutils)

另外配置还有
[fcgi-program:x]

[eventlistener:x]

[rpcinterface:x]

包含指定的配置文件
[include]
files = /an/absolute/filename.conf /an/absolute/*.conf foo.conf config??.conf

【Linux】类Unix 操作系统进程监控控制工具 Supervisor的更多相关文章

  1. monitorix(linux)系统和网络监控公工具

    一.monitorix Monitorix是一款功能非常强大的免费开源轻型工具,目的在于监测Linux中的系统和网络资源.它可以定期收集系统和网络数据,并使用自己的Web界面,通过图形显示相关信息.M ...

  2. 进程管理工具 Supervisor

    要想在终端后台常驻进程,首先想到的是在命令后加 & 符号,来达到隐藏程序在后台的目的,尽管看起来进程已经在后台运行了,实际上终端会话关闭时进程还是会被 kill 掉,这种问题一般是采用搭配 n ...

  3. Linux和类Unix系统上5个最佳开源备份工具

    一个好的备份最基本的目的就是为了能够从一些错误中恢复: 人为的失误 磁盘阵列或是硬盘故障 文件系统崩溃 数据中心被破坏等等. 所以,我为大家罗列了一些开源的软件备份工具. 当为一个企业选择备份工具的时 ...

  4. Linux 和类 Unix 系统上5个最佳开源备份工具

    转载:http://linux.cn/article-4623-weixin.html#rd?sukey=cbbc36a2500a2e6cb7678c4d38b691a9fa7403b259f898e ...

  5. Linux资源监控命令/工具(综合)

    目录: ps pstree pidof top free uptime ifuser lsof mpstat vmstst pidstat iostat iotop watch sar 1.ps 1) ...

  6. 监控 Linux 系统的 7 个命令行工具

    监控 Linux 系统的 7 个命令行工具: " 深入 关于Linux最棒的一件事之一是你能深入操作系统,来探索它是如何工作的,并寻找机会来微调性能或诊断问题.这里有一些基本的命令行工具,让 ...

  7. UNIX操作系统和Linux操作系统介绍

    UNIX操作系统(尤尼斯),是一个强大的多用户.多任务操作系统,支持多种处理器架构,按照操作系统的分类,属于分时操作系统,最早由KenThompson.DennisRitchie和DouglasMcI ...

  8. 监控Linux性能的18个命令行工具

    监控 Linux 性能的 18 个命令行工具 对于系统和网络管理员来说每天监控和调试Linux系统的性能问题是一项繁重的工作.在IT领域作为一名Linux系统的管理员工作5年后,我逐渐 认识到监控和保 ...

  9. 《Unix/Linux日志分析与流量监控》书稿完成

    <Unix/Linux日志分析与流量监控>书稿完成 近日,历时3年创作的75万字书稿已完成,本书紧紧围绕网络安全的主题,对各种Unix/Linux系统及网络服务日志进行了全面系统的讲解,从 ...

随机推荐

  1. Hire Me, Microsoft China

    为微软中国工作是一个愿望.对于其他的股票期权,令人难以置信的小吃店或很酷的工作室,引诱他们的可能性.很多人都想为微软中国工作,谁知道,也许你就是其中之一.这个博客是专门为在微软中国工作.做它的工作空缺 ...

  2. 简单的Markdown功能实现——marked模块的使用

    marked是一个markdown 解析.编译器,通过引入marked模块,可以实现一个简单的markdown编辑器.使用方式如下: Install 新建一个项目文件夹,在项目中下载marked模块 ...

  3. cocoapods 升级到最新beta 版

    1 确保你的ruby源是https://rubygems.org/  国内的镜像不一定行 2 sudo gem install -n /usr/local/bin cocoapods 或者 sudo ...

  4. static 使用要注意的地方

     protected static string headimg = string.Empty; 这里用到 static ,下面如果这样写    object himg = DBUtility.DbH ...

  5. 从PowerDesigner表字段的Name到EF实体类属性的Display Name(根据PowerDesigner生成EF实体类中文注释和验证元数据)

    第一步:将PowerDesigner表字段的中文Name填入Comment中:工具-Execute Commands-Edit/Run Script... '********************* ...

  6. Docker version 1.12.5建立registry私库

    sudo docker run -d -p 5000:5000 -v /opt/data/registry:/var/lib/registry registry :前面的是宿主机的地址(/opt/da ...

  7. Spring操作指南-IoC基础环境配置(基于注解手动装配)

    Source: http://code.taobao.org/p/LearningJavaEE/src/LearningSpring002%20-%20Wiring%20beans%20with%20 ...

  8. STM32 assert_param

    在STM32的固件库和提供的例程中,到处都可以见到assert_param()的使用.如果打开任何一个例程中的stm32f10x_conf.h文件,就可以看到实际上assert_param是一个宏定义 ...

  9. The prefix "util" for element "util:list" is not bound.

    http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4. ...

  10. 常用的Linux命令

    1.如何创建一个目录?mkdir DirectoryName 2.如何进入服务器根目录?ls / 3.如何查看日历?cal 4.如何修改密码?passwd 5.如何查看当前用户信息?whoami 6. ...