Welcome! Log In Create A New Profile

Advanced

upstart after nginx update not working

September 10, 2013 07:21AM
hi
i've created the upstart with the following config

# nginx

description "nginx http daemon"
author "George Shammas <georgyo@gmail.com>"

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

env DAEMON=/usr/sbin/nginx
env PID=/var/run/nginx.pid

expect fork
respawn
respawn limit 10 5
#oom never

pre-start script
$DAEMON -t
if [ $? -ne 0 ]
then exit $?
fi
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:
wget http://nginx.org/download/nginx-<version>.tar.gz
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/nginx.pid \
--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 \
--http-fastcgi-temp-path=/var/cache/nginx/fastcgi_tempmake
make
sudo make install

#Advise old master process to start a new master process using the updated binary:
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.
SubjectAuthorPosted

upstart after nginx update not working

cobain86September 10, 2013 07:21AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 67
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready