6 # Default values to use if none are supplied in the config file.
8 # Running mythbackend as non-root requires you to ensure that audio/video
9 # devices used for recording have suitable user permissions. One way
10 # to achieve this is to modify existing or create new udev rules which
11 # assign these devices to a non-root group with rw permissions and add
12 # your mythbackend user to that group. Be aware that console.perms can
13 # also affect device permissions and may need additional configuration.
14 # Running as non-root may also introduce increased process latency.
16 # User who should start the mythbackend processes
19 # Startup options for mythbackend
22 # Name of mythbackend log file
23 LOG_FILE
='/var/log/mythbackend.log'
25 # Logging options for mythbackend (empty means '-v important,general')
28 ###############################################################################
30 CONFIG_FILE
=/etc
/conf.d
/mythbackend
31 PIDFILE
=/var
/run
/mythbackend.pid
33 if [[ -f ${CONFIG_FILE} ]]; then
37 pid
="$(cat ${PIDFILE} 2>/dev/null || pidof mythbackend)";
40 mbe_user_home
="$(getent passwd ${MBE_USER}|cut -d : -f 6)"
44 stat_busy
"Starting MythTV Backend"
47 if [[ "${pid}" -gt 0 ]] && kill -0 "${pid}"; then
51 touch ${PIDFILE} ${LOG_FILE}
52 chown
"$MBE_USER" ${PIDFILE} ${LOG_FILE}
53 if su
"$MBE_USER" -c "HOME=${mbe_user_home} mythbackend \
55 --logfile $LOG_FILE $LOG_OPTS \
56 --pidfile ${PIDFILE} $MBE_OPTIONS";
58 add_daemon mythbackend
66 stat_busy
"Stopping MythTV Backend"
67 if [[ "${pid}" -gt 0 ]] && kill $pid &>/dev
/null
; then
70 rm ${PIDFILE} 2>/dev
/null
80 echo "usage: $0 {start|stop|restart}"