#!/sbin/runscript # Copyright 1999-2004 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # $Header: CONFIG_FILE="/etc/udrec_suite/ud_suite.conf" PATH=$PATH:/usr/bin #depend() { # need localmount #} checkconfig() { if [ -e ${CONFIG_FILE} ] then . ${CONFIG_FILE} else eerror "no ${CONFIG_FILE} found. exiting ..." return 1 fi # # see if vlc is enabled and exit if not # if [ $USE_VLC == 1 ] && [ ! -x $VLC ] then eerror "no vlc found although enabled, exiting!" return 1 fi } start() { checkconfig || return 1 ebegin "Starting udrec_suite" start-stop-daemon --start --background --quiet --chuid $UDREC_USER --exec $UD_DAEMON -- $UD_DAEMON_OPTS # # Xvfb # XLOCK=`basename \`ls /tmp/.X?-lock | sort | tail -n 1 \`` DISP=`echo $XLOCK | sed -e 's/^\.X\([0-9]\)-lock/\1/g'` [ -z "$DISP" ] && DISP=0 NEXT_DISP=`echo "$DISP+1" | bc` echo -n "Starting Xvfb on display $NEXT_DISP: " # # start Xvfb as root ! # start-stop-daemon --start --background --quiet --chuid $UDREC_USER --exec $XVFB -- :$NEXT_DISP >/dev/null 2>&1 # # start vlc if configured # if [ ${USE_VLC} == "1" ]; then echo -n "Starting vlc: " start-stop-daemon --start --quiet --exec $UD_STARTVLC -- >/dev/null 2>&1 fi eend $? } stop() { ebegin "Stopping udrec_suite" start-stop-daemon --stop --oknodo --signal 9 --quiet --name ud_daemon.pl start-stop-daemon --stop --oknodo --signal 9 --quiet --exec /usr/bin/mono start-stop-daemon --stop --oknodo --signal 9 --quiet --exec /usr/X11R6/bin/Xvfb start-stop-daemon --stop --oknodo --signal 9 --quiet --exec /usr/bin/vlc start-stop-daemon --stop --oknodo --signal 9 --quiet --name udrecemu start-stop-daemon --stop --oknodo --signal 9 --quiet --exec /usr/bin/nfrec eend $? }