Change rotate() to reopen_logs()

This commit is contained in:
Jeremy Hinegardner 2010-12-12 17:46:45 -07:00
parent 1c673dcb63
commit f172741083
2 changed files with 9 additions and 8 deletions

View File

@ -91,19 +91,20 @@ upgrade() {
sleep 1 sleep 1
if [[ -f ${oldbin_pidfile} && -f ${pidfile} ]]; then if [[ -f ${oldbin_pidfile} && -f ${pidfile} ]]; then
killproc -p $oldbin_pidfile $prog -QUIT killproc -p $oldbin_pidfile $prog -QUIT
success $"$nginx online upgrade" success $"$prog online upgrade"
echo echo
return 0 return 0
else else
failure $"$nginx online upgrade" failure $"$prog online upgrade"
echo
return 1 return 1
fi fi
} }
# Tell nginx to rotate its logs # Tell nginx to reopen logs
rotate() { reopen_logs() {
configtest_q || return 6 configtest_q || return 6
echo -n $"Rotating $nginx logs: " echo -n $"Reopening $prog logs: "
killproc -p $pidfile $prog -USR1 killproc -p $pidfile $prog -USR1
retval=$? retval=$?
echo echo
@ -119,7 +120,7 @@ case "$1" in
rh_status_q || exit 0 rh_status_q || exit 0
$1 $1
;; ;;
restart|configtest|rotate) restart|configtest|reopen_logs)
$1 $1
;; ;;
force-reload|upgrade) force-reload|upgrade)
@ -138,6 +139,6 @@ case "$1" in
restart restart
;; ;;
*) *)
echo $"Usage: $0 {start|stop|reload|configtest|status|force-reload|upgrade|restart|rotate}" echo $"Usage: $0 {start|stop|reload|configtest|status|force-reload|upgrade|restart|reopen_logs}"
exit 2 exit 2
esac esac

View File

@ -6,7 +6,7 @@
compress compress
sharedscripts sharedscripts
postrotate postrotate
/etc/init.d/nginx rotate /etc/init.d/nginx reopen_logs
endscript endscript
} }