#!/sbin/runscript # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License, v2 or later # $Header: $ depend() { need net use mysql } checkconfig() { [ -z "${MYTH_USER}" ] && MYTH_USER="nobody" for i in $(groups "${MYTH_USER}") do [ "${i}" = "audio" ] && audio="yes" [ "${i}" = "video" ] && video="yes" done [ -z "${audio}" -o -z "${video}" ] && { ewarn "" [ -z "${audio}" ] && \ ewarn "${HILITE}${MYTH_USER}${NORMAL} is not in the audio group" [ -z "${video}" ] && \ ewarn "${HILITE}${MYTH_USER}${NORMAL} is not in the video group" ewarn "" ewarn "insufficient permissions discovered" ewarn "mythbackend may not start correctly" ewarn "" } } start() { [ -n "${MYTH_NOWARN}" ] || checkconfig [ -z "${MYTH_USER}" ] && MYTH_USER="nobody" [ -z "${MYTH_LOG}" ] && MYTH_LOG="/var/log/mythtv/mythbackend.log" [ -z "${MYTH_PID}" ] && MYTH_PID="/var/run/mythtv/mythbackend.pid" HOME="$(dirname "${MYTH_PID}")" QTDIR=/usr/qt/3 # Work around any strange permissions that may be on these files rm -f "${MYTH_LOG}" rm -f "${MYTH_PID}" ebegin "Starting myth backend" start-stop-daemon --start --quiet \ --chuid "${MYTH_USER}" --exec /usr/bin/mythbackend \ -- --daemon --pidfile "${MYTH_PID}" --logfile "${MYTH_LOG}" eend $? } stop () { [ -z "${MYTH_PID}" ] && MYTH_PID="/var/run/mythtv/mythbackend.pid" ebegin "Stopping myth backend" start-stop-daemon --stop --quiet --pidfile="${MYTH_PID}" eend $? }