From dea8cfad263f3915a086c4fb0194ae1aab3c52d9 Mon Sep 17 00:00:00 2001
From: Mark Harrison <mark@omniti.com>
Date: Fri, 30 May 2008 16:27:58 +0000
Subject: [PATCH] Adding reload support to the resmon init script, and changed
 the web server child process to ignore the HUP signal so killproc -HUP (and
 killall -HUP) will work correctly.

git-svn-id: https://labs.omniti.com/resmon/trunk@117 8c0face9-b7db-6ec6-c4b3-d5f7145c7d55
---
 lib/Resmon/Status.pm |  1 +
 rc/resmon            | 11 ++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/lib/Resmon/Status.pm b/lib/Resmon/Status.pm
index 83521d2..2c092c6 100644
--- a/lib/Resmon/Status.pm
+++ b/lib/Resmon/Status.pm
@@ -307,6 +307,7 @@ sub serve_http_on {
   $self->{child} = fork();
   if($self->{child} == 0) {
     eval {
+      $SIG{'HUP'} = 'IGNORE';
       while(my $client = $handle->accept) {
         my $req;
         my $proto;
diff --git a/rc/resmon b/rc/resmon
index 0eb91dd..bee7cff 100755
--- a/rc/resmon
+++ b/rc/resmon
@@ -43,6 +43,12 @@ restart() {
 	stop
 	start
 }	
+reload() {
+	echo -n $"Reloading resmon: "
+	killproc resmon -HUP
+	echo
+	return $?
+}
 
 case "$1" in
   start)
@@ -54,9 +60,12 @@ case "$1" in
   status)
   	rhstatus
 	;;
-  restart|reload)
+  restart)
   	restart
 	;;
+  reload)
+	reload
+	;;
   condrestart)
   	[ -f /var/lock/subsys/resmon ] && restart || :
 	;;
-- 
GitLab