]> git.pld-linux.org Git - packages/mythtv.git/commitdiff
- formatting
authorElan Ruusamäe <glen@pld-linux.org>
Sat, 22 Jan 2011 21:08:25 +0000 (21:08 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    mythbackend.init -> 1.7

mythbackend.init

index 81c9c9dd9b4f73dfef5758e6a4afadd3b985f4d8..f4f5211c71bf06551b091b6a24c16228f9cd869a 100644 (file)
@@ -21,54 +21,62 @@ pidfile=/var/run/mythtv/mythbackend.pid
 
 start() {
        # Start daemons.
-       if [ ! -f /var/lock/subsys/mythbackend ]; then
-               msg_starting "Mythbackend"
-               daemon /usr/sbin/mythbackend --daemon \
-                       --user mythtv \
-                       --logfile /var/log/mythtv/mythbackend.log \
-                       --pidfile $pidfile \
-                       $OPTIONS
-               RETVAL=$?
-               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/mythbackend
-       else
+       if [ -f /var/lock/subsys/mythbackend ]; then
                msg_already_running "Mythbackend"
+               return
        fi
+
+       msg_starting "Mythbackend"
+       daemon /usr/sbin/mythbackend --daemon \
+               --user mythtv \
+               --logfile /var/log/mythtv/mythbackend.log \
+               --pidfile $pidfile \
+               $OPTIONS
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/mythbackend
 }
 
 stop() {
        # Stop daemons.
-       if [ -f /var/lock/subsys/mythbackend ]; then
-               msg_stopping "Mythbackend"
-               killproc --pidfile mythtv/mythbackend.pid mythbackend
-               rm -f /var/lock/subsys/mythbackend /var/run/mythtv/mythbackend.pid >/dev/null 2>&1
-       else
+       if [ ! -f /var/lock/subsys/mythbackend ]; then
                msg_not_running "Mythbackend"
+               return
+       fi
+
+       msg_stopping "Mythbackend"
+       killproc --pidfile mythtv/mythbackend.pid mythbackend
+       rm -f /var/lock/subsys/mythbackend $pidfile >/dev/null 2>&1
+}
+
+flush-logs() {
+       if [ ! -f /var/lock/subsys/mythbackend ]; then
+               return
        fi
+
+       show "Rotating %s logs" "Mythbackend"
+       killproc --pidfile $pidfile mythbackend -HUP
 }
 
 RETVAL=0
 # See how we were called.
 case "$1" in
-start)
+  start)
        start
        ;;
-stop)
+  stop)
        stop
        ;;
-restart)
+  restart)
        stop
        start
        ;;
-flush-logs)
-       if [ -f /var/lock/subsys/mythbackend ]; then
-               show "Rotating %s logs" "Mythbackend"
-               killproc --pidfile mythtv/mythbackend.pid mythbackend -HUP
-       fi
+  flush-logs)
+       flush-logs
+       ;;
+  status)
+       status --pidfile $pidfile mythbackend
        ;;
-status)
-       status mythbackend
-;;
-*)
+  *)
        msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
        exit 3
 esac
This page took 0.031314 seconds and 4 git commands to generate.