Skip to content

Instantly share code, notes, and snippets.

@lesleh
Created June 17, 2015 14:59
Show Gist options
  • Save lesleh/cb718b4aca407166682e to your computer and use it in GitHub Desktop.
Save lesleh/cb718b4aca407166682e to your computer and use it in GitHub Desktop.
# nginx
description "nginx http daemon"
author "George Shammas <[email protected]>"
start on (filesystem and net-device-up IFACE=lo)
stop on runlevel [!2345]
env DAEMON=/opt/nginx/sbin/nginx
env PID=/opt/nginx/logs/nginx.pid
expect fork
respawn
respawn limit 10 5
#oom never
pre-start script
$DAEMON -t
if [ $? -ne 0 ]
then exit $?
fi
end script
post-stop exec start-stop-daemon --stop --pidfile $PID --name nginx --exec $DAEMON --signal QUIT
exec $DAEMON
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment