Articles of supervisord

用supervisord运行(并监视)nginx

我将从我的使用案例开始,因为我很可能没有使用正确的工具来完成这项工作。 请让我知道,如果我这样做是错误的 用例:我有一个托pipe多个Web应用的CentOS服务器。 我希望能够相信我的Web服务器和应用程序服务器将运行。 我的堆栈看起来像 networking服务器:nginx 应用程序服务器:uWSGI web框架:flask / python 我想用supervisord来监视nginx和uWSGI。 在我的/etc/supervisor.conf中,我有 [program:nginxgo] command = /usr/sbin/nginx autostart=true autorestart=unexpected exitcodes=0 stdout_logfile=/home/webdev/nginxgo.log stderr_logfile=/home/webdev/nginxgoerr.log [program:uwsgi_emperor_go] command = uwsgi –emperor /etc/uwsgi/emperor.ini autostart=true autorestart=unexpected stopsignal=INT stdout_logfile=/home/webdev/emp.log stderr_logfile=/home/webdev/emperr.log directory=/home/webdev/ user=webdev 我得到了uWSGI进程。 当我input[root@mymachine]# /usr/local/bin/supervisord -n -c /etc/supervisord.conf 输出是 2014-11-26 14:07:56,917 CRIT Supervisor running as root (no user in config file) 2014-11-26 14:07:56,951 […]

Ubuntu – Supervisord和virtualenv

我试图从主pipe运行一系列Python应用程序。 它在Mac OSX上工作正常,但是当我尝试在Ubuntu上运行相同的应用程序时,主pipe似乎没有激活virtualenv,所以我的脚本抛出错误。 这是我的结构: /home/user/Sites/my-site – app.py – venv – supervisor.conf 我的supervisor.conf文件如下所示: [program:python-app] autorestart = false autostart = false startsecs = 0 command = python app.py startretries = 1 environment=PYTHONPATH="%(here)s" [unix_http_server] file = /tmp/supervisor.sock [supervisord] logfile = logs/supervisord.log pidfile = logs/supervisord.pid environment=PYTHONPATH="%(here)s" [supervisorctl] serverurl = unix:///tmp/supervisor.sock [rpcinterface:supervisor] supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface [unix_http_server] username = supervisor_admin password […]

如何添加服务的前缀/标签到主pipe标准输出

当我在一个映像中运行多个服务(例如postfix和其他邮件服务)时,我在docker映像中使用supervisor。 当我将stdout / stderr从所有服务redirect到pipe理员,pipe理员也会login到stdout / stderr我希望在控制台上有实际日志输出的前缀/标签,以知道哪个日志来自哪个服务。 我找不到任何configuration设置,但也许你知道一个方法。 这里是一个例子,看起来像福尔曼:

Supervisord似乎正在运行,但受监视的程序不会启动

我已经从ubuntu 10.04(64位)的系统软件包中安装了supervisord 3.0a8。 Supervisor服务似乎正在运行,但它不启动已configuration的程序。 有趣的是,这个确切的configuration在另一个系统上运行,并按预期工作。 主要的configuration文件如下所示: ; /etc/supervisor/supervisord.conf [unix_http_server] chmod=0700 file=/var/run/supervisor.sock [supervisord] logfile=/var/log/supervisor/supervisord.log childlogdir=/var/log/supervisor pidfile=/var/run/supervisord.pid [rpcinterface:supervisor] supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface [supervisorctl] serverurl=unix:///var/run/supervisor.sock [include] files = /etc/supervisor/conf.d/*.conf 一个示例程序configuration如下所示: ; /etc/supervisor/conf.d/sample.conf [program:sample] directory=/opt/sample command=/opt/sample/run.sh 其中,/ /opt/sample/run.sh是: #!/bin/bash while true; do T=`date` echo "[$T] Running!" >> /var/log/sample.log sleep 1 done 而且,下面是一些有关supervisord运行实例的附加信息: root@myhost:~# supervisorctl version 3.0a8 root@myhost:~# which supervisorctl /usr/bin/supervisorctl […]

supervisord:错误:<class'socket.error'>

我不能得到supervisord工作; 在开始过程之后: # supervisord -n -c /etc/supervisord.conf 2013-05-29 11:34:11,861 CRIT Supervisor running as root (no user in config file) 2013-05-29 11:34:11,868 INFO supervisord started with pid 7893 从另一个terminal,我得到: # supervisorctl -c supervisord.conf status error: <class 'socket.error'>, [Errno 2] No such file or directory: file: <string> line: 1 在stream浪者中运行,CentOS 6.3 x86_64。 组态: [unix_http_server] file=/var/run/supervisor.sock ; (the […]

用supervisord运行django自定义pipe理命令

我想使用supervisord运行我的Django项目的一些命令,但我不断收到以下错误: supervisor.log: 2012-05-18 17:52:15,784 INFO spawnerr: can't find command 'source' 如果我删除“源”命令,日志显示相同的错误: can't find command 'python' 。 supervisord.conf摘录: [program:django] directory=/home/mf/projects/djangopj/ command=beanstalkd -l 127.0.0.1 -p 11300 command=source /home/mf/virtualenvs/env/bin/activate command=python manage.py command1 command=python manage.py command2 user=mf autostart=true autorestart=true 我试图删除目录,并添加绝对path的命令,但我一直得到相同的错误。 我使用以下命令运行supervisord: supervisord -c supervisord.conf -l supervisor.log

pipe理守护进程:没有可用的前台模式

我试图用supervisord来pipe理一个进程,但是这个进程没有在前台运行的选项:它总是守护进程。 (这是Zabbix服务器)。 有没有办法与主pipepipe理守护进程? 任何工具,将使其运行在前台? 或者,也许,不知何故使用pidfile?

我如何在FreeBSD上自动启动主pipe?

在FreeBSD上有没有预先存在的supervisord启动脚本? 如果不是的话,那么为FreeBSD编写rc.d脚本有一个很好的指导吗? 我对这个平台很陌生。 谢谢。 更新 : 我现在在/usr/local/etc/rc.d/supervisord有以下内容,但似乎没有工作。 我没有看到有关supervisord的启animation面中的任何东西。 #!/bin/sh # PROVIDE: supervisord # REQUIRE: LOGIN # KEYWORD: shutdown . /etc/rc.subr name="supervisord" rcvar=`set_rcvar` load_rc_config "$name" command="/usr/local/bin/${name}" command_args="-c /usr/local/etc/supervisord.conf" supervisord_enable=${supervisord_enable-"NO"} supervisord_pidfile=${supervisord_pidfile-"/var/run/supervisord.pid"} pidfile="${supervisord_pidfile}" run_rc_command "$1"

服务器'unix_http_server'运行没有任何HTTPauthentication检查

我的supervisord告诉我,它没有任何HTTP身份validation检查运行。 supervisor> maintail 2015-03-03 16:57:03,832 CRIT Server 'unix_http_server' running without any HTTP authentication checking 虽然我无法打开它的默认端口9001 。 如何打开它,以及如何启用HTTP身份validation检查? unix_http_serverconfiguration文件部分如下: [unix_http_server] file=/var/run/supervisor.sock chmod=0770 chown=root:supervisor

Django + gunicorn + virtualenv + Supervisord的问题

只有当gunicorn通过supervisord启动时,我的virtualenv + gunicorn设置有一个奇怪的问题。 我意识到,这可能是我的supervisord很好的问题,我会很感激任何反馈在一个更好的地方寻求帮助… 简而言之:当我从我的用户shell中运行gunicorn时,在我的virtualenv中,一切都在完美地运行。 我能够访问我的Django项目的所有视图。 supervisord在系统启动时启动gunicorn时,一切正常。 但是,如果我必须杀死gunicorn_django进程,或者如果我执行supervisord重新启动,那么一旦gunicorn_django重新启动,每个请求都会用一个奇怪的Traceback回答: (…) File "/home/hc/prod/venv/lib/python2.6/site-packages/Django-1.2.5-py2.6.egg/django/db/__init__.py", line 77, in connection = connections[DEFAULT_DB_ALIAS] File "/home/hc/prod/venv/lib/python2.6/site-packages/Django-1.2.5-py2.6.egg/django/db/utils.py", line 92, in __getitem__ backend = load_backend(db['ENGINE']) File "/home/hc/prod/venv/lib/python2.6/site-packages/Django-1.2.5-py2.6.egg/django/db/utils.py", line 50, in load_backend raise ImproperlyConfigured(error_msg) TemplateSyntaxError: Caught ImproperlyConfigured while rendering: 'django.db.backends.postgresql_psycopg2' isn't an available database backend. Try using django.db.backends.XXX, where XXX is one of: 'dummy', 'mysql', […]