]> git.pld-linux.org Git - packages/inn.git/commitdiff
- use functions, daemon with --user, better status
authorPaweł Gołaszewski <blues@pld-linux.org>
Thu, 14 Aug 2008 12:19:20 +0000 (12:19 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    inn.init -> 1.26

inn.init

index 2ef02d52660edf0ab7fb0c7cc76d5c5a3902d5b6..9b27ee99f384ef29f299f2c275c960386ab08971 100644 (file)
--- a/inn.init
+++ b/inn.init
@@ -26,11 +26,7 @@ if is_yes "${NETWORKING}"; then
 else
        exit 0
 fi
-
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
        if [ ! -f /var/lock/subsys/inn ]; then
                grep -v "#" /etc/news/inn.conf | grep ovmethod | grep ovdb 2>&1 >/dev/null
                RETVAL=$?
@@ -41,7 +37,7 @@ case "$1" in
                fi
 
                msg_starting "INN"
-               daemon su news -c inndstart
+               daemon --user=news inndstart
                if is_yes "$DOINNWATCH" ; then
                        msg_starting "INN Watch"
                        busy
@@ -63,8 +59,9 @@ case "$1" in
        else
                msg_already_running "INN"
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/inn ]; then
                msg_stopping "INN"
                busy
@@ -108,10 +105,20 @@ case "$1" in
        else
                msg_not_running INN
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        status innd
-       exit $?
+       innstat
        ;;
   reload|force-reload)
        if [ -f /var/lock/subsys/inn ]; then
@@ -126,9 +133,9 @@ case "$1" in
        fi
        ;;
   restart)
-       $0 stop
+       stop
        sleep 2
-       $0 start
+       start
        ;;
   *)
        msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
This page took 0.035547 seconds and 4 git commands to generate.