Author: blues                        Date: Wed Aug 20 13:40:00 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- get rid of setsid, su and other hacks, allow to start innwatch when news
  user has /bin/false.

---- Files affected:
SOURCES:
   inn.init (1.27 -> 1.28) 

---- Diffs:

================================================================
Index: SOURCES/inn.init
diff -u SOURCES/inn.init:1.27 SOURCES/inn.init:1.28
--- SOURCES/inn.init:1.27       Thu Aug 14 14:25:14 2008
+++ SOURCES/inn.init    Wed Aug 20 15:39:54 2008
@@ -32,29 +32,19 @@
                RETVAL=$?
                if [ $RETVAL -eq 0 ]; then
                        msg_starting "INN ovdb_monitor"
-                       su news -c ovdb_init 2>&1 > /dev/null
-                       ok
+                       daemon --user news ovdb_init
                fi
 
                msg_starting "INN"
                daemon --user=news inndstart
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/inn
                if is_yes "$DOINNWATCH" ; then
                        msg_starting "INN Watch"
                        busy
-                       su news -c "umask 002
-                       /usr/bin/setsid /usr/bin/innwatch &" </dev/null >&0 2>&0
+                       daemon --fork --user news /usr/bin/innwatch
                        RETVAL=$?
                        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/inn
-                       ps -C innwatch >/dev/null 2>&1 || usleep 500000
-                       if [ $RETVAL -eq 0 ] && ps -C innwatch >/dev/null 2>&1; 
then
-                               ok
-                               touch /var/lock/subsys/inn
-                       else
-                               RETVAL=1
-                               fail
-                       fi
-               else
-                       touch /var/lock/subsys/inn
                fi
        else
                msg_already_running "INN"
@@ -117,6 +107,7 @@
        stop
        ;;
   status)
+       status innwatch
        status innd
        if [ $? -eq 0 ]; then
                innstat
================================================================

---- CVS-web:
    
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/inn.init?r1=1.27&r2=1.28&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to