#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/media-tv/mythtv/files/mythbackend.rc6,v 1.5 2005/03/02 08:52:23 eradicator Exp $ depend() { need net use mysql } checkconfig() { for i in $(groups "${MYTH_USER/:*/}") ; do [[ "${i}" == "audio" ]] && audio="yes" [[ "${i}" == "video" ]] && video="yes" done if [ -z "${audio}" -o -z "${video}" ] ; then 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 "" fi } start() { [[ -z "${MYTH_USER}" ]] && MYTH_USER="nobody:nobody" [[ -z "${MYTH_LOG}" ]] && MYTH_LOG="/var/log/mythtv/mythbackend.log" [[ -z "${MYTH_PID}" ]] && MYTH_PID="/var/run/mythtv/mythbackend.pid" [[ -z "${MYTH_WARN}" || "${MYTH_WARN}" == "yes" ]] && checkconfig [[ -z "${MYTH_NICE}" ]] && MYTH_NICE="0" HOME="$(dirname "${MYTH_PID}")" QTDIR=/usr/qt/3 # Work around any strange permissions that may be on these files. chown -R "${MYTH_USER}" "$(dirname "${MYTH_LOG}")" chown -R "${MYTH_USER}" "$(dirname "${MYTH_PID}")" ebegin "Starting myth backend" start-stop-daemon --start --quiet --chuid "${MYTH_USER}" \ --exec /usr/bin/mythbackend --nicelevel "${MYTH_NICE}" -- \ --daemon --pidfile "${MYTH_PID}" --logfile "${MYTH_LOG}" \ --verbose ${MYTH_VERBOSE} 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 $? }