[CUWiN-Dev] hellowdog + newsyslog

Bill Comisky bcomisky at pobox.com
Sun Oct 9 22:00:19 CDT 2005


/var/log/hellowdog isn't currently rotated by newsyslog.  The patch below 
traps SIGUSR1 in hellowdog and calls '/etc/rc.d/hellowdog restart'.  The 
newsyslog.conf file is modified to send SIGUSR1 to the hellowdog process 
(HUP is already used to reset the timer).

Is this the "right" way to do this?  Any better signal to use that USR1?
Let me know & I'll commit.

bill

--
Bill Comisky
bcomisky at pobox.com


Index: patches/patch-newsyslog.conf
===================================================================
--- patches/patch-newsyslog.conf	(revision 3559)
+++ patches/patch-newsyslog.conf	(working copy)
@@ -1,7 +1,8 @@
  --- etc/newsyslog.conf	2003-11-22 18:49:50.000000000 -0600
  +++ etc/newsyslog.conf	2004-06-19 01:42:20.000000000 -0500
-@@ -14,3 +14,4 @@
+@@ -14,3 +14,5 @@
   /var/log/wtmp				644  7    *    168  ZBN
   /var/log/wtmpx				644  7    *    168  ZBN
   /var/log/xferlog			640  7    250  *    Z
  +/var/log/daemon				644  2    250  *   Z
++/var/log/hellowdog				644  2    250  *   Z  /var/run/hellowdog.pid  SIGUSR1
Index: extras/usr/sbin/hellowdog
===================================================================
--- extras/usr/sbin/hellowdog	(revision 3559)
+++ extras/usr/sbin/hellowdog	(working copy)
@@ -47,6 +47,7 @@
  	set -i
  	trap - HUP
  	trap reset_watchdog HUP
+	trap '/etc/rc.d/hellowdog restart' USR1
  	set +i

  	reset_watchdog
@@ -78,7 +79,7 @@
  		sleep 1
  	done

-} < /dev/null > /var/log/hellowdog 2> /dev/null &
+} < /dev/null >> /var/log/hellowdog 2> /dev/null &

  echo $! > /var/run/$progname.pid


More information about the CU-Wireless-Dev mailing list