Author: mis                          Date: Sun Feb 25 15:06:50 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- based on apache one

---- Files affected:
SOURCES:
   nginx.init (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/nginx.init
diff -u /dev/null SOURCES/nginx.init:1.1
--- /dev/null   Sun Feb 25 16:06:50 2007
+++ SOURCES/nginx.init  Sun Feb 25 16:06:45 2007
@@ -0,0 +1,93 @@
+#!/bin/sh
+#
+# nginx        Nginx Web Server
+#
+# chkconfig:   345 85 15
+# description: Apache is a World Wide Web server.  It is used to serve \
+#              HTML files and CGI.
+# processname: nginx
+# pidfile:     /var/run/nginx.pid
+# config:      /etc/nginx/nginx.conf
+
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; 
then
+               # nls "ERROR: Networking is down. %s can't be run." <service>
+               msg_network_down nginx
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+if [ -d "${HTTPD_CONF:-'/etc/nginx/nginx.conf'}" ]; then
+       CFG="-f ${HTTPD_CONF:-'/etc/nginx/nginx.conf'}"
+elif [ -n "$HTTPD_CONF" ]; then
+       echo "error: HTTPD_CONF='$HTTPD_CONF': not a file, not a directory"
+       exit 1
+else
+       CFG=""
+fi
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/nginx ]; then
+               msg_starting nginx
+               daemon nginx $CFG $HTTPD_OPTS
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nginx
+       else
+               msg_already_running nginx
+       fi
+       ;;
+  stop)
+       # Stop daemons.
+       if [ -f /var/lock/subsys/nginx ]; then
+               msg_stopping nginx.${HTTPD_MPM}
+               killproc --waitforname nginx --waitfortime 60 nginx $CFG
+               # Delete pidfile only when nginx was called successfully
+               if [ $? -eq 0 ]; then
+                       rm -f /var/lock/subsys/nginx /var/run/nginx.pid 
/var/run/nginx.loc* >/dev/null 2>&1
+               fi
+       else
+               msg_not_running nginx
+       fi
+       ;;
+  status)
+       status nginx
+       RETVAL=$?
+       ;;
+  restart)
+       $0 stop
+       $0 start
+       ;;
+  reload|force-reload|graceful)
+       if [ -f /var/lock/subsys/nginx ]; then
+               msg_reloading nginx
+               killproc nginx "-HUP"
+               RETVAL=$?
+       else
+               msg_not_running nginx >&2
+               RETVAL=7
+       fi
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|status}"
+       exit 3
+       ;;
+esac
+
+exit $RETVAL
================================================================
_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to