3 # Starts the mythbackend as a daemon
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 binary=/usr/bin/mythbackend
26 OPTIONS="$OPTIONS --daemon --logfile /var/log/mythtv/$prog.log --pidfile /var/run/mythtv/$prog.pid"
28 # See how we were called.
32 if [ ! -f /var/lock/subsys/$prog ]; then
33 msg_starting "Mythbackend"
34 daemon --user mythtv "cd $MYTHTV_HOME && $binary $OPTIONS"
37 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
39 msg_already_running "Mythbackend"
44 if [ -f /var/lock/subsys/$prog ]; then
45 msg_stopping "Mythbackend"
46 killproc --pidfile mythtv/$prog.pid $binary
47 rm -f /var/lock/subsys/$prog /var/run/mythtv/$prog.pid >/dev/null 2>&1
49 msg_not_running "Mythbackend"
61 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"