]> git.pld-linux.org Git - packages/nginx.git/commitdiff
- init
authorsardzent <sardzent@pld-linux.org>
Fri, 30 Nov 2007 19:00:19 +0000 (19:00 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    nginx-light.init -> 1.1
    nginx-mail.init -> 1.1
    nginx-perl.init -> 1.1

nginx-light.init [new file with mode: 0644]
nginx-mail.init [new file with mode: 0644]
nginx-perl.init [new file with mode: 0644]

diff --git a/nginx-light.init b/nginx-light.init
new file mode 100644 (file)
index 0000000..69f9f3f
--- /dev/null
@@ -0,0 +1,100 @@
+#!/bin/sh
+#
+# nginx        Nginx Web Server (light version)
+#
+# chkconfig:   345 85 15
+# description: Nginx is a World Wide Web server.  It is used to serve \
+#              HTML files and CGI.
+# processname: nginx-light
+# pidfile:     /var/run/nginx-light.pid
+# config:      /etc/nginx/nginx-light.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
+               msg_network_down nginx-light
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+if [ -d "${HTTPD_CONF:-'/etc/nginx/nginx-light.conf'}" ]; then
+       CFG="-f ${HTTPD_CONF:-'/etc/nginx/nginx-light.conf'}"
+elif [ -n "$HTTPD_CONF" ]; then
+       echo "error: HTTPD_CONF='$HTTPD_CONF': not a file, not a directory"
+       exit 1
+else
+       CFG=""
+fi
+
+start() {
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/nginx-light ]; then
+               msg_starting nginx-light
+               daemon nginx-light $CFG $HTTPD_OPTS
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nginx-light
+       else
+               msg_already_running nginx-light
+       fi
+}
+
+stop() {
+       # Stop daemons.
+       if [ -f /var/lock/subsys/nginx-light ]; then
+               msg_stopping nginx-light
+               killproc --waitforname nginx-light --waitfortime 60 nginx-light $CFG
+               # Delete pidfile only when nginx was called successfully
+               if [ $? -eq 0 ]; then
+                       rm -f /var/lock/subsys/nginx-light /var/run/nginx-light.pid >/dev/null 2>&1
+               fi
+       else
+               msg_not_running nginx-light
+       fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  status)
+       status nginx-light
+       RETVAL=$?
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  reload|force-reload|graceful)
+       if [ -f /var/lock/subsys/nginx-light ]; then
+               msg_reloading nginx-light
+               killproc nginx-light -HUP
+               RETVAL=$?
+       else
+               msg_not_running nginx-light
+               RETVAL=7
+       fi
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|status}"
+       exit 3
+       ;;
+esac
+
+exit $RETVAL
diff --git a/nginx-mail.init b/nginx-mail.init
new file mode 100644 (file)
index 0000000..c77152a
--- /dev/null
@@ -0,0 +1,100 @@
+#!/bin/sh
+#
+# nginx        Nginx Web Server (mail version)
+#
+# chkconfig:   345 85 15
+# description: Nginx is a World Wide Web server.  It is used to serve \
+#              HTML files and CGI.
+# processname: nginx-mail
+# pidfile:     /var/run/nginx-mail.pid
+# config:      /etc/nginx/nginx-mail.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
+               msg_network_down nginx-mail
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+if [ -d "${HTTPD_CONF:-'/etc/nginx/nginx-mail.conf'}" ]; then
+       CFG="-f ${HTTPD_CONF:-'/etc/nginx/nginx-mail.conf'}"
+elif [ -n "$HTTPD_CONF" ]; then
+       echo "error: HTTPD_CONF='$HTTPD_CONF': not a file, not a directory"
+       exit 1
+else
+       CFG=""
+fi
+
+start() {
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/nginx-mail ]; then
+               msg_starting nginx-mail
+               daemon nginx-mail $CFG $HTTPD_OPTS
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nginx-mail
+       else
+               msg_already_running nginx-mail
+       fi
+}
+
+stop() {
+       # Stop daemons.
+       if [ -f /var/lock/subsys/nginx-mail ]; then
+               msg_stopping nginx-mail
+               killproc --waitforname nginx-mail --waitfortime 60 nginx-mail $CFG
+               # Delete pidfile only when nginx was called successfully
+               if [ $? -eq 0 ]; then
+                       rm -f /var/lock/subsys/nginx-mail /var/run/nginx-mail.pid >/dev/null 2>&1
+               fi
+       else
+               msg_not_running nginx-mail
+       fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  status)
+       status nginx-mail
+       RETVAL=$?
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  reload|force-reload|graceful)
+       if [ -f /var/lock/subsys/nginx-mail ]; then
+               msg_reloading nginx-mail
+               killproc nginx-mail -HUP
+               RETVAL=$?
+       else
+               msg_not_running nginx-mail
+               RETVAL=7
+       fi
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|status}"
+       exit 3
+       ;;
+esac
+
+exit $RETVAL
diff --git a/nginx-perl.init b/nginx-perl.init
new file mode 100644 (file)
index 0000000..e8b171b
--- /dev/null
@@ -0,0 +1,100 @@
+#!/bin/sh
+#
+# nginx        Nginx Web Server (perl version)
+#
+# chkconfig:   345 85 15
+# description: Nginx is a World Wide Web server.  It is used to serve \
+#              HTML files and CGI.
+# processname: nginx-perl
+# pidfile:     /var/run/nginx-perl.pid
+# config:      /etc/nginx/nginx-perl.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
+               msg_network_down nginx-perl
+               exit 1
+       fi
+else
+       exit 0
+fi
+
+if [ -d "${HTTPD_CONF:-'/etc/nginx/nginx-perl.conf'}" ]; then
+       CFG="-f ${HTTPD_CONF:-'/etc/nginx/nginx-perl.conf'}"
+elif [ -n "$HTTPD_CONF" ]; then
+       echo "error: HTTPD_CONF='$HTTPD_CONF': not a file, not a directory"
+       exit 1
+else
+       CFG=""
+fi
+
+start() {
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/nginx-perl ]; then
+               msg_starting nginx-perl
+               daemon nginx-perl $CFG $HTTPD_OPTS
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/nginx-perl
+       else
+               msg_already_running nginx-perl
+       fi
+}
+
+stop() {
+       # Stop daemons.
+       if [ -f /var/lock/subsys/nginx-perl ]; then
+               msg_stopping nginx-perl
+               killproc --waitforname nginx-perl --waitfortime 60 nginx-perl $CFG
+               # Delete pidfile only when nginx was called successfully
+               if [ $? -eq 0 ]; then
+                       rm -f /var/lock/subsys/nginx-perl /var/run/nginx-perl.pid >/dev/null 2>&1
+               fi
+       else
+               msg_not_running nginx-perl
+       fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  status)
+       status nginx-perl
+       RETVAL=$?
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  reload|force-reload|graceful)
+       if [ -f /var/lock/subsys/nginx-perl ]; then
+               msg_reloading nginx-perl
+               killproc nginx-perl -HUP
+               RETVAL=$?
+       else
+               msg_not_running nginx-perl
+               RETVAL=7
+       fi
+       ;;
+  *)
+       msg_usage "$0 {start|stop|restart|reload|force-reload|graceful|status}"
+       exit 3
+       ;;
+esac
+
+exit $RETVAL
This page took 0.157848 seconds and 4 git commands to generate.