upstart after nginx update not working

cobain86 nginx-forum at
Tue Sep 10 11:21:11 UTC 2013

i've created the upstart with the following config

# nginx
description "nginx http daemon"
author "George Shammas <georgyo at>"
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
env DAEMON=/usr/sbin/nginx
env PID=/var/run/
expect fork
respawn limit 10 5
#oom never
pre-start script
        $DAEMON -t
        if [ $? -ne 0 ]
                then exit $?
end script
exec $DAEMON

And thats how i made the nginx update

#Basically it boils down to the following:
#Get PID of old master process by inspecting output of ps:
ps auxwww | grep nginx
#Now, install the new binary:
tar -xzf nginx-<version>.tar.gz
cd nginx-<version>
./configure \
--sbin-path=/usr/sbin/nginx \
--conf-path=/etc/nginx/nginx.conf \
--pid-path=/var/run/ \
--lock-path=/var/lock/subsys/nginx \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_geoip_module \
--http-client-body-temp-path=/var/cache/nginx/client_body_temp \
--http-proxy-temp-path=/var/cache/nginx/proxy_temp \
sudo make install
#Advise old master process to start a new master process using the updated
sudo kill -s USR2 2941
#Gracefully shut down old worker processes:
sudo kill -s WINCH 2941
#Gracefully exit old master process:
sudo kill -s QUIT 2941

So after the update the Upstart is'nt working anymore for nginx. I have to
stop the service manually and start it again.

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

More information about the nginx mailing list