From 07b7088b988b28b842bf956e4c8d5ac3f32ce359 Mon Sep 17 00:00:00 2001 From: oboyle Date: Thu, 31 Jul 2014 10:52:04 -0500 Subject: [PATCH] Synchronized upstart script with the one recommended by nginx. http://wiki.nginx.org/Upstart --- nginx/templates/upstart.jinja | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/nginx/templates/upstart.jinja b/nginx/templates/upstart.jinja index 3257cbe..f0cc377 100644 --- a/nginx/templates/upstart.jinja +++ b/nginx/templates/upstart.jinja @@ -1,8 +1,23 @@ -# startup script for Nginx - -respawn - -start on filesystem or runlevel [2345] +# nginx + +description "nginx http daemon" +author "George Shammas " + +start on (filesystem and net-device-up IFACE=lo) stop on runlevel [!2345] - -exec /usr/sbin/nginx -c /etc/nginx/nginx.conf + +env DAEMON=/usr/sbin/nginx + +expect fork +respawn +respawn limit 10 5 +#oom never + +pre-start script + $DAEMON -t + if [ $? -ne 0 ] + then exit $? + fi +end script + +exec $DAEMON