From: Heiko Z. <smi...@us...> - 2016-07-02 12:55:47
|
Update of /cvsroot/devil-linux/build/scripts/scripts In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1896/scripts/scripts Added Files: nginx Log Message: added nginx init script (Udo Lembke) removed type from sample config --- NEW FILE: nginx --- #!/bin/bash # # $Source: /cvsroot/devil-linux/build/scripts/scripts/nginx,v $ # $Revision: 1.1 $ # $Date: 2016/07/02 12:55:45 $ # # http://www.devil-linux.org # ### BEGIN INIT INFO # Provides: nginx # Required-Start: $network $syslog $named # Required-Stop: $network $syslog $named # Default-Start: 3 5 # Default-Stop: 6 0 # Description: starts the nginx webserver ### END INIT INFO # settings source /etc/sysconfig/config # parameters NAME="Nginx" CONFIGNAME=NGINX DAEMON=/usr/sbin/nginx PARAMETER="/etc/nginx/nginx.conf" PIDFILE="/var/run/nginx.pid" # source function library source /etc/init.d/functions eval START=\$START_$CONFIGNAME # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} # Force execution if not called by a runlevel directory. test $link = $base && START=yes test "$START" = "yes" || exit 0 if [ ! -e $DAEMON ]; then echo echo "$DAEMON not found. Did you install the package?" exit 1 fi case "$1" in start) echo -n "Starting $NAME: " loadproc $DAEMON -c $PARAMETER ;; stop) if [ ! -e $PIDFILE ]; then echo -n "$NAME not running!" print_status failure else echo -n "Shutting down $NAME: " $DAEMON -s quit if [ $? = 0 ]; then print_status success else echo -n "something is going wrong here - perhaps you must delete (stale) $PIDFILE" print_status failure fi fi ;; reload) if [ ! -e $PIDFILE ]; then echo -n "$NAME not running!" print_status failure else echo -n "Reload $NAME: " $DAEMON -s reload if [ $? = 0 ]; then print_status success else print_status failure fi fi ;; testconfig) echo "Test $NAME config: " $DAEMON -t if [ $? = 0 ]; then print_status success else print_status failure fi ;; restart) $0 stop sleep 1 $0 start ;; *) echo "Usage: $0 {start|stop|reload|testconfig|restart}" exit 1 ;; esac |