Ticket #3370: etc.rc.d.init.d.mythbackend-pidfile

File etc.rc.d.init.d.mythbackend-pidfile, 1.3 KB (added by Nick Morrott <knowledgejunkie@…>, 13 years ago)

Adds pidfile support to mythbackend init script

Line 
1Index: mythtv/contrib/etc.rc.d.init.d.mythbackend
2===================================================================
3--- mythtv/contrib/etc.rc.d.init.d.mythbackend  (revision 13356)
4+++ mythtv/contrib/etc.rc.d.init.d.mythbackend  (working copy)
5@@ -9,6 +9,8 @@
6 #              system is started, in runlevel 5. This allows scheduled \
7 #              recordings to occur without manual intervention.
8 # processname: mythbackend
9+# pidfile: /var/run/mythbackend.pid
10+# config: /etc/sysconfig/mythbackend
11 
12 # Copyright (c) by Michael Thomson <linux at m-thomson dot net>
13 # With thanks to Stu Tomlinson <stu at nosnilmot dot com>
14@@ -61,7 +63,8 @@
15            echo -n "Starting ${MBE_PROG}: "
16            # /usr/local/bin/mythbackend -d -l /some/log/file
17            daemon --user ${MBE_USER} ${MBE_LOCATION}${MBE_PROG} \
18-                                      -d -l ${MBE_LOGFILE} ${MBE_OPTIONS}
19+                --daemon --logfile ${MBE_LOGFILE} ${MBE_OPTIONS} \
20+                --pidfile /var/run/${MBE_PROG}.pid
21            RETVAL=$?
22            [ $RETVAL -eq 0 ] && touch /var/lock/subsys/${MBE_PROG}
23            echo
24@@ -73,7 +76,7 @@
25        echo -n "Stopping ${MBE_PROG}: "
26        killproc ${MBE_LOCATION}${MBE_PROG}
27        RETVAL=$?
28-       [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/${MBE_PROG}
29+       [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/${MBE_PROG} /var/run/${MBE_PROG}.pid
30        echo
31         return $RETVAL
32 }