Skip to content

Instantly share code, notes, and snippets.

@stoutZero
Created June 6, 2016 07:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stoutZero/be78da6fc37af3cbe8ec4eec8b672f98 to your computer and use it in GitHub Desktop.
Save stoutZero/be78da6fc37af3cbe8ec4eec8b672f98 to your computer and use it in GitHub Desktop.
# nginx, https://www.nginx.com/resources/wiki/start/topics/examples/ubuntuupstart/
# save as: /etc/init.d/nginx.conf
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment