3 # mythbackend Server component of MythTV
5 # chkconfig: 2345 86 14
6 # description: Starts the mythbackend process as a daemon after the XWindows \
7 # system is started, in runlevel 5. This allows scheduled \
8 # recordings to occur without manual intervention.
9 # processname: mythbackend
10 # pidfile: /var/run/mythtv/mythbackend.pid
11 # config: /etc/sysconfig/mythbackend
13 # Source function library.
14 . /etc/rc.d/init.d/functions
16 if [ -f /etc/sysconfig/mythbackend ]; then
17 . /etc/sysconfig/mythbackend
20 ## Defaults, override them in /etc/sysconfig/mythbackend
21 : ${MYTHTV_HOME=/var/lib/mythtv}
23 OPTIONS="$OPTIONS --daemon --logfile /var/log/mythtv/mythbackend.log --pidfile /var/run/mythtv/mythbackend.pid"
26 # See how we were called.
30 if [ ! -f /var/lock/subsys/mythbackend ]; then
31 msg_starting "Mythbackend"
32 daemon --user mythtv "cd $MYTHTV_HOME && /usr/sbin/mythbackend $OPTIONS"
34 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/mythbackend
36 msg_already_running "Mythbackend"
41 if [ -f /var/lock/subsys/mythbackend ]; then
42 msg_stopping "Mythbackend"
43 killproc --pidfile mythtv/mythbackend.pid mythbackend
44 rm -f /var/lock/subsys/mythbackend /var/run/mythtv/mythbackend.pid >/dev/null 2>&1
46 msg_not_running "Mythbackend"
55 if [ -f /var/lock/subsys/mythbackend ]; then
56 show "Rotating %s logs" "Mythbackend"
57 killproc --pidfile mythtv/mythbackend.pid mythbackend -HUP
64 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"