Hot answers tagged

99

The correct answer is that supervisor requires you to re-read and update when you place a new configuration file. Restarting is not the answer, as that will affect other services. Try: supervisorctl reread supervisorctl update


35

There is a plugin called superlance. You install it with pip install superlance or download it at: http://pypi.python.org/pypi/superlance The next thing you do is you go into your supervisord.conf and add the following lines: [eventlistener:crashmail] command=/usr/local/bin/crashmail -a -m email1@example.com events=PROCESS_STATE This should be followed ...


24

You could use sudo in place of your custom script to accomplish the same thing. That is, given the default supervisord configuration, in which only root can run supervisorctl, you could put an entry like this into /etc/sudoers: alice ALL = (root) NOPASSWD:/usr/bin/supervisorctl restart app1 bob ALL = (root) NOPASSWD:/usr/bin/supervisorctl restart app2 ...


22

I had the same issue, a sudo service supervisord reload did the trick, though I don't know if that is the answer to your question.


18

Ah, you use supervisorctl start groupname:* I discovered this by typing just supervisorctl start and being told: Error: start requires a process name start <name> Start a process start <gname>:* Start all processes in a group start <name> <name> Start multiple processes or groups start all Start all processes ...


13

I created an upstart script for ubuntu 9.10 For example I installed supervisor into a virtual environment, then start and control supervisor from upstart. create a text file /etc/init/supervisord.conf the contents are: description "supervisord" start on runlevel [345] stop on runlevel [!345] expect fork respawn exec ...


12

Reloading the master supervisor process may work, but it will have unintended side effects if you have more than one process being monitored by supervisor. The correct way to do it is to issue supervisorctl reread which causes it to scan configuration files for any changes: root@debian:~# supervisorctl reread gunicorn: changed Then, simply reload that ...


12

This is what I use on RHEL 5.4 and CentOS 5.5 I'm not sure wether it's depending on some configuration settings in my supervisord.conf. But it seems to work OK. You need to run the following command after installing it chkconfig --add supervisord [/etc/rc.d/init.d/supervisord] #!/bin/sh # # /etc/rc.d/init.d/supervisord # # Supervisor is a client/server ...


12

There is an "run" command in catalina.sh. It works perfectly fine with supervisor: [program:tomcat] command=/path/to/tomcat/bin/catalina.sh run process_name=%(program_name)s startsecs=5 stopsignal=INT user=tomcat redirect_stderr=true stdout_logfile=/var/log/tomcat.log The tomcat run as "catalina.sh run" works in foreground, has the correct pid and accepts ...


11

If gunicorn_django is daemonizing itself, it's not the kind of program supervisor is designed to manage. Supervisor expects its supervised programs to run in the foreground so it can monitor if they've exited. See supervisord docs.


10

Cron periodically calling a shell script to ensure a service is running is actually a pretty decent entry-level method for service monitoring on simple networks. Cron can check once per minute, so that may be good enough for the demands of your environment if downtimes of < 60 seconds is acceptable. It's easy to set up and use. Supervisor, on the other ...


9

This feature has been added to Supervisor recently environment=PATH="/home/site/environments/master/bin:%(ENV_PATH)s" https://github.com/Supervisor/supervisor/blob/master/supervisor/skel/sample.conf#L8 See also https://stackoverflow.com/questions/12900402/supervisor-and-environment-variables


9

The command you provide should use the python binary inside the virtual environment: command = /home/user/Sites/my-site/venv/bin/python /home/user/Sites/my-site/app.py


7

The problem is the --preload parameter. The first solution is not to use the --preload. The second solution is to follow this: # Reload a new master with new workers kill -s USR2 $PID # Graceful stop old workers kill -s WINCH $OLDPID # Graceful stop old master kill -s QUIT $OLDPID The third solution is to use the package ...


6

I'd use lsof to find out what process is listening on those ports. lsof -i tcp | grep LISTEN Once you've worked out what process it is, that's half the battle.


6

In order to deal with the problem, we'll need some program running in foreground, which exits whenever the daemon exits, and which also proxies signals to the daemon. Consider using the following script bash script: #! /usr/bin/env bash set -eu pidfile="/var/run/your-daemon.pid" command=/usr/sbin/your-daemon # Proxy signals function kill_app(){ kill ...


6

You're probably missing the [supervisord] section in the file. See this.


6

The Illegal seek error is caused by the code in supervisord that is responsible for log file rotation. To redirect to stdout/stderr you have to disable log file rotation, as explained here: http://veithen.github.io/2015/01/08/supervisord-redirecting-stdout.html


5

There is a Debian/Ubuntu script in official Supervisor GitHub repo: https://github.com/Supervisor/initscripts/blob/master/debian-norrgard


5

If you installed supervisord from the port sysutils/py-supervisor then this rc file is already present... (than to voretaq7 for pointing this out). The basic framework of a rc file is: #!/bin/sh . /etc/rc.subr name="supervisord" rcvar=`set_rcvar` load_rc_config "$name" command="/usr/local/bin/${name}" command_args="" run_rc_command "$1" Creating the ...


5

Take a look at unix-http-server section. Change your configuration file as belows: [unix_http_server] file=/tmp/supervisor.sock ; (the path to the socket file) chmod=0770 ; sockef file mode (default 0700) chown=zope:zoperun ; socket file uid:gid owner ;username=user ; (default is no username (open server)) ...


5

I've just stumbled across the same issue, so I'll leave the reasons it happened to me. We had supervisor installed into the global path (not a virtualenv) using pip, which meant we were running the latest version. However, this is undesirable from a server maintenance point of view, so we switched the older version in Apt. pip uninstall doesn't clear up ...


5

http://supervisord.org/configuration.html#program-x-section-settings says "Values containing non-alphanumeric characters should be placed in quotes"


5

Honestly, the workers_per_application is more of a performance tweak to ensure your application can consume 100% of the CPU at any time. It does not mean that it will. You can configure all of your applications to have 9 workers... as long as you keep in mind that there is a potential that one application could be working on something very difficult which ...


5

The --config option must be specified before the sentry subcommand, like so: sentry --config=/somedir/sentry.conf.py start ....


5

Thanks to Mark for the link to that script; here is my working example for CentOS: #!/bin/bash # Source: https://confluence.atlassian.com/plugins/viewsource/viewpagesrc.action?pageId=252348917 function shutdown() { date echo "Shutting down Tomcat" unset CATALINA_PID # Necessary in some cases unset LD_LIBRARY_PATH # Necessary in some cases ...


5

You shouldn't be running your gunicorn server as root, just think if someone found an exploit in your code can do anything to the server. Put the pidfile in /tmp or /var/tmp and run as a non privileged user.


5

That's the whole idea, to use systemd (or upstart etc) inside a container. Docker is used most of the time to run a single service per container, so for a complex site you would need a container for the web server and another one for the database server. With a process manager you could run both in the same container. Which approach is better is ...



Only top voted, non community-wiki answers of a minimum length are eligible