#!/bin/sh ### BEGIN INIT INFO # Provides: web-server # Required-Start: php-fcgi # Required-Stop: php-fcgi # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # X-Interactive: false # Short-Description: Start/stop nginx web server ### END INIT INFO PATH=/bin:/usr/bin:/usr/sbin:/sbin DAEMON=/opt/schplurtz/nginx/sbin/nginx NAME=nginx DESC="Nginx Web Server" OPTS= start() { echo -n "Starting $DESC: " start-stop-daemon --start -x "$DAEMON" -- $OPTS echo "$NAME." } stop() { echo -n "Stopping $DESC: " "$DAEMON" -s quit echo "$NAME." } reload() { echo -n "Reloading $DESC: " "$DAEMON" -s reload echo "$NAME." } test -x "$DAEMON" || { echo "$DAEMON" not present. exiting ; exit 0 ; } case "$1" in (start) start ;; (stop) stop ;; (reload) reload ;; (restart|force-reload) stop sleep 1 start ;; (*) N=/etc/init.d/$NAME echo "Usage: $N {start|stop|reload|restart|force-reload}" >&2 exit 1 ;; esac exit 0