I have the following two exec
statements in an Ubuntu upstart
script:
exec /bin/su -c "cd /var/www/ssrc/jvwf/; \
python /var/www/ssrc/jvwf/manage.py runfcgi --settings=spzr.settings-admin \
--pythonpath=/var/www/ssrc/jvwf method=prefork socket=/tmp/www/spzr-adm.socket \
pidfile=/tmp/www/spzr-adm.pid minspare=2 maxspare=4 maxchildren=10 \
maxrequests=65535 daemonize=false" - www-data
exec /bin/su -c "cd /var/www/ssrc/jvwf/; \
python /var/www/ssrc/jvwf/manage.py runfcgi --settings=spzr.settings-live \
--pythonpath=/var/www/ssrc/jvwf method=prefork socket=/tmp/www/spzr.socket \
pidfile=/tmp/www/spzr.pid minspare=2 maxspare=4 maxchildren=10 \
maxrequests=65535 daemonize=false" - www-data
The second command survives, whilst the first one stops working. Same happens when the order of the two commands is inverted.
Both commands work perfectly when run individually (i.e. alone) from the same upstart service using exactly the same syntax as above.
What am I doing wrong?
Each upstart job can have only one primary program, so running two things means having two upstart jobs.
So you need to split those into two separate jobs with unique names. If you'd like to control them together, you can have a third control job which they follow
/etc/init/control-fcgi.conf:
start on runlevel [2345]
stop on runlevel [016]
And then both of the other two would do:
start on starting control-fcgi
stop on stopping control-fcgi