The attached patch for the CURRENT version of whoson does four
things.  It adds %status and %restart sections and modifies the
%start and %stop sections to start whoson well in advance of other
packages that may use whoson such as postfix, courier-imap, etc.

Bill
-- 
INTERNET:   b...@celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
Voice:          (206) 236-1676  Mercer Island, WA 98040-0820
Fax:            (206) 232-9186

It is surprising how much new stuff users find that developers never do.
You put a copy in front of a normal user and they find all these bugs that
you would think developers would find. The real users and developers are
completely different species as far as I am concerned.
    --Linux creator Linus Torvalds
--- /tmp/rc.whoson      2009-02-09 14:37:02.000000000 -0800
+++ rc.whoson   2009-02-09 08:58:18.473474978 -0800
@@ -13,14 +13,28 @@
 
 %common
     whoson_pidfile="@l_prefix@/var/whoson/whoson.pid"
+    whoson_signal () {
+        [ -f $whoson_pidfile ] && kill -$1 `cat $whoson_pidfile`
+    }
+
+%status -u @l_susr@ -o
+    whoson_usable="unknown"
+    whoson_active="no"
+    rcService whoson enable yes && \
+        whoson_signal 0 && whoson_active="yes"
+    echo "whoson_enable=\"$whoson_enable\""
+    echo "whoson_usable=\"$whoson_usable\""
+    echo "whoson_active=\"$whoson_active\""
 
-%start -u @l_susr@
+%start -p 200 -u @l_susr@
     rcService whoson enable yes || exit 0
+    rcService whoson active yes && exit 0
     @l_prefix@/sbin/whosond >$whoson_pidfile
     exit 0
 
-%stop -u @l_susr@
+%stop -p 910 -u @l_susr@
     rcService whoson enable yes || exit 0
+    rcService whoson active no  && exit 0
     kill -TERM `cat $whoson_pidfile`
     rm -f $whoson_pidfile 2>/dev/null || true
     exit 0
@@ -33,6 +47,11 @@
     @l_prefix@/sbin/whosond >$whoson_pidfile
     exit 0
 
+%restart -u @l_susr@
+    rcService whoson enable yes || exit 0
+    rcService whoson active no  && exit 0
+    rc whoson stop start
+
 %daily -u @l_susr@
     rcService whoson enable yes || exit 0
     shtool rotate -f \

Reply via email to