#! /bin/sh # nginx Startup script for nginx # # chkconfig: - 86 14 # description: nginx web server # # Author: Ryan Norbauer # Modified: Geoffrey Grosenbach http://topfunky.com # Modified: Gabriel Handford http://ducktyper.com set -e PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DESC="nginx daemon" NAME=nginx DAEMON=<%= nginx_bin_path %> CONFIGFILE=<%= nginx_conf_path %> PIDFILE=<%= nginx_pid_path %> # Gracefully exit if the package has been removed. test -x $DAEMON || exit 0 start() { $DAEMON -c $CONFIGFILE || echo -n " already running" } stop() { kill -QUIT `cat $PIDFILE` || echo -n " not running" } reload() { kill -HUP `cat $PIDFILE` || echo -n " can't reload" } case "$1" in start) echo -n "Starting $DESC: $NAME" start ;; stop) echo -n "Stopping $DESC: $NAME" stop ;; reload) echo -n "Reloading $DESC configuration..." reload echo "reloaded." ;; restart) echo -n "Restarting $DESC: $NAME" stop # Sleep before start sleep 1 start ;; *) echo "Usage: $0 {start|stop|restart|reload}" >&2 exit 3 ;; esac exit 0