Permalink
Browse files

Graceful restart support

  • Loading branch information...
1 parent c9fd2f6 commit 4817dd0ce3fa5d64f778a5a0fadcef5658db8ee3 Andrew Rodland committed Aug 10, 2010
Showing with 16 additions and 2 deletions.
  1. +16 −2 cat-psgi-init
View
@@ -124,6 +124,14 @@ restart() {
return $?
}
+reload() {
+ log_daemon_msg "Reloading $APPNAME" $UNIXNAME
+
+ [ -s $PIDFILE ] && kill -HUP $(cat $PIDFILE) >/dev/null 2>&1
+ log_end_msg $?
+ return $?
+}
+
# See how we were called.
case "$1" in
start)
@@ -132,14 +140,20 @@ case "$1" in
stop)
stop
;;
- restart|force-reload)
+ restart)
restart
;;
+ reload)
+ reload
+ ;;
+ force-reload)
+ check_running && reload || restart
+ ;;
check|check-compile)
check_compile
;;
*)
- echo $"Usage: $0 {start|stop|restart|check}"
+ echo $"Usage: $0 {start|stop|restart|reload|force-reload|check}"
exit 1
esac
exit $?

0 comments on commit 4817dd0

Please sign in to comment.