Nginx and upstart

skrode nginx-forum at
Tue Apr 2 18:43:18 UTC 2013


I'm using the following script to keep nginx up and running:

start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]

env DAEMON=/usr/sbin/nginx
env CONF=/etc/nginx/nginx.conf
env PID=/var/run/

respawn limit 10 5

pre-start script
        if [ $? -ne 0 ]; then
                exit $?
end script

exec $DAEMON -c $CONF -g "daemon off;" > /dev/null 2>&1

It works fine except if I kill the master process with eg. kill -5. If I
kill it with kill command the pid keeps changing every few seconds. Any idea
how to fix this?

Posted at Nginx Forum:,238036,238036#msg-238036

More information about the nginx mailing list