We use the manager to deploy the python web application. When deployed, the web application is installed on the server using the assembly, and the script to launch the supervisor is created using the collect.recipe.supervisor command. This script is called at the end of the deployment process by the cloth script. The problem is that when the script is deployed, a SIGHUP signal is sent to the process, which forces the supervisor to restart (according to this line: https://github.com/Supervisor/supervisor/blob/master/supervisor/supervisord.py#L300 ), but for some reason, the web application does not restart after its completion. There is no log output after the following:
2012-10-24 15:23:51,510 WARN received SIGHUP indicating restart request 2012-10-24 15:23:51,511 INFO waiting for app-server to die 2012-10-24 15:23:54,650 INFO waiting for app-server to die 2012-10-24 15:23:57,653 INFO waiting for app-server to die 2012-10-24 15:24:00,657 INFO waiting for app-server to die 2012-10-24 15:24:01,658 WARN killing 'app-server' (28981) with SIGKILL 2012-10-24 15:24:01,659 INFO stopped: app-server (terminated by SIGKILL)
So, I have two questions. First: does anyone know why the supervisor reboots to SIGHUP? I could not find an explanation for this, and there are no command line options that would disable this behavior. Second question: how to fix the problem we are facing? We tried to start the dispatcher with nohup, but SIGHUP is still received. The strange thing is that this does not happen when I log in to the server, start the dispatcher manually and log out.
Here is the supervisor script generated by buildout:
#!/usr/bin/python2.6 import sys sys.path[0:0] = [ '/home/username/.buildout/eggs/supervisor-3.0b1-py2.6.egg', '/home/username/.buildout/eggs/meld3-0.6.9-py2.6.egg', '/home/username/.buildout/eggs/distribute-0.6.30-py2.6.egg', ] import sys; sys.argv.extend(["-c","/home/username/app_directory/parts/supervisor/supervisord.conf"]) import supervisor.supervisord if __name__ == '__main__': sys.exit(supervisor.supervisord.main())
And here is the configuration file for the supervisor, also created by buildout:
[supervisord] childlogdir = /home/username/app_directory/var/log logfile = /home/username/app_directory/var/log/supervisord.log logfile_maxbytes = 50MB logfile_backups = 10 loglevel = info pidfile = /home/username/app_directory/var/supervisord.pid umask = 022 nodaemon = false nocleanup = false [unix_http_server] file = /home/username/app_directory/supervisor.sock username = username password = apasswd chmod = 0700 [supervisorctl] serverurl = unix:///home/username/app_directory/supervisor.sock username = username password = apasswd [rpcinterface:supervisor] supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface [program:app-server] command = /home/username/app_directory/bin/gunicorn --bind 0.0.0.0:5000 app:wsgi process_name = app-server directory = /home/username/app_directory/bin priority = 50 redirect_stderr = false directory = /home/username/app_directory
We do not want to install a fixed version of the dispatcher before we really understand the problem, so any information will be highly appreciated.
Thank you in advance