]> git.pld-linux.org Git - packages/mythtv.git/blobdiff - mythbackend.init
- updatd files
[packages/mythtv.git] / mythbackend.init
index f4f5211c71bf06551b091b6a24c16228f9cd869a..93c6ab3ba8fbee50fc055071e11a326e2364f4ba 100644 (file)
@@ -13,6 +13,9 @@
 # Source function library.
 . /etc/rc.d/init.d/functions
 
+MYTHTV_USER=mythtv
+OPTIONS=
+
 if [ -f /etc/sysconfig/mythbackend ]; then
        . /etc/sysconfig/mythbackend
 fi
@@ -28,7 +31,7 @@ start() {
 
        msg_starting "Mythbackend"
        daemon /usr/sbin/mythbackend --daemon \
-               --user mythtv \
+               --user $MYTHTV_USER \
                --logfile /var/log/mythtv/mythbackend.log \
                --pidfile $pidfile \
                $OPTIONS
@@ -48,6 +51,17 @@ stop() {
        rm -f /var/lock/subsys/mythbackend $pidfile >/dev/null 2>&1
 }
 
+condrestart() {
+       if [ ! -f /var/lock/subsys/mythbackend ]; then
+               msg_not_running "Mythbackend"
+               RETVAL=$1
+               return
+       fi
+
+       stop
+       start
+}
+
 flush-logs() {
        if [ ! -f /var/lock/subsys/mythbackend ]; then
                return
@@ -70,6 +84,12 @@ case "$1" in
        stop
        start
        ;;
+  try-restart)
+       condrestart 0
+       ;;
+  force-reload)
+       condrestart 7
+       ;;
   flush-logs)
        flush-logs
        ;;
@@ -77,7 +97,7 @@ case "$1" in
        status --pidfile $pidfile mythbackend
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|try-restart|force-reload|flush-logs|status}"
        exit 3
 esac
 
This page took 0.103627 seconds and 4 git commands to generate.