]> git.pld-linux.org Git - packages/nginx.git/blobdiff - nginx.init
oh… we can keep webserver(*) in -common only
[packages/nginx.git] / nginx.init
index 16da7a9c39c8cb18c2e3579e92fbf2a298ab69c0..cc334abe45b919d964725ef41514323a2087ef47 100755 (executable)
@@ -1,13 +1,13 @@
 #!/bin/sh
 #
-# nginx        Nginx Web Server (@flavor@ version)
+# nginx        Nginx Web Server (@type@ version)
 #
 # chkconfig:   345 85 15
 # description:  Nginx is an HTTP(S) server, HTTP(S) reverse \
 #               proxy and IMAP/POP3 proxy server
-# processname: nginx-@flavor@
-# pidfile:     /var/run/nginx-@flavor@.pid
-# config:      /etc/nginx/nginx-@flavor@.conf
+# processname: nginx-@type@
+# pidfile:     /var/run/nginx-@type@.pid
+# config:      /etc/nginx/nginx-@type@.conf
 
 # Source function library
 . /etc/rc.d/init.d/functions
@@ -15,8 +15,8 @@
 # Source networking configuration.
 . /etc/sysconfig/network
 
-nginx="/usr/sbin/nginx-@flavor@"
-svname="nginx (@flavor@)"
+nginx="/usr/sbin/nginx-@type@"
+svname="nginx (@type@)"
 prog=${nginx##*/}
 
 sysconfig="/etc/sysconfig/$prog"
@@ -143,6 +143,13 @@ upgrade() {
        fi
 }
 
+# Tell nginx to reopen logs
+# http://nginx.org/en/docs/control.html#logs
+reopen_logs() {
+       show "Reopening $svname logs"
+       killproc -p $pidfile $prog -USR1
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -163,9 +170,12 @@ case "$1" in
   reload|graceful)
        reload
        ;;
-  force-reload|upgrade) 
+  force-reload|upgrade)
        upgrade
        ;;
+  reopen-logs)
+       reopen_logs
+       ;;
   checkconfig|configtest)
        checkconfig 1
        ;;
@@ -174,7 +184,7 @@ case "$1" in
        RETVAL=$?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|graceful|checkconfig|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|graceful|reopen-logs|checkconfig|status}"
        exit 3
        ;;
 esac
This page took 0.056008 seconds and 4 git commands to generate.