[mythtv-users] mythbackend startup script for Debian

Marius Schrecker marius at schrecker.org
Tue Dec 13 07:05:45 EST 2005


> On Monday 12 December 2005 03:33, Marius Schrecker wrote:
>> Hi,
>>
>>  I'm having a hard time setting up a startup script on Debian unstable
>> using svn from a few days ago.
>>
>> The sample scripts in the contrib directory of the source don't use
>> Debian
>> controls, and as mythbackend has a builtin daemon mode I'm not sure I
>> should use a script based on skeleton.
>>
>> Can anyone point me at a working script, or tell me the best approach to
>> make one myself? I think I used a script from the 0.18 deb last time
>> (before my hard disk crash), but this time it's pure svn.
>>
>> Cheers
>>
>> Marius
>
> here's my init.d script for Kanotix64:
>
> ##############################################################################
> #! /bin/sh
> #
> # mythtv-server MythTV capture and encoding backend
> #
> # Based on:
> #
> # skeleton      example file to build /etc/init.d/ scripts.
> #               This file should be used to construct scripts for
> /etc/init.d.
> #
> #               Written by Miquel van Smoorenburg <miquels at cistron.nl>.
> #               Modified for Debian GNU/Linux
> #               by Ian Murdock <imurdock at gnu.ai.mit.edu>.
> #
> # Version:      @(#)skeleton  1.9.1  08-Apr-2002  miquels at cistron.nl
> #
>
> PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
> DAEMON=/usr/local/bin/mythbackend
> NAME="mythbackend"
> DESC="MythTV server"
>
> test -x $DAEMON || exit 0
>
> set -e
>
> USER=mythtv
> RUNDIR=/var/run/mythtv
> ARGS="--daemon --logfile /var/log/mythtv/mythbackend.log --pidfile
> $RUNDIR/$NAME.pid"
> EXTRA_ARGS=""
> NICE=0
>
> if [ -f /etc/mythtv/mythbackend ]; then
>   . /etc/mythtv/mythbackend
> fi
>
> ARGS="$ARGS $EXTRA_ARGS"
>
> mkdir -p $RUNDIR
> chown -R $USER $RUNDIR
>
>
> case "$1" in
>   start)
>         echo -n "Starting $DESC: $NAME"
>         start-stop-daemon --start --pidfile $RUNDIR/$NAME.pid \
>                 --chuid $USER --nicelevel $NICE --exec $DAEMON -- $ARGS
>         echo "."
>         ;;
>   stop)
>         echo -n "Stopping $DESC: $NAME "
>         start-stop-daemon --stop --oknodo --pidfile $RUNDIR/$NAME.pid \
>                 --chuid $USER --exec $DAEMON -- $ARGS
>         echo "."
>         ;;
>   restart|force-reload)
>         echo -n "Restarting $DESC: $NAME"
>         start-stop-daemon --stop --oknodo --pidfile $RUNDIR/$NAME.pid \
>                 --chuid $USER --exec $DAEMON -- $ARGS
>         echo "."
>         sleep 3
>         start-stop-daemon --start --pidfile $RUNDIR/$NAME.pid \
>                 --chuid $USER --nicelevel $NICE --exec $DAEMON -- $ARGS
>         echo "."
>         ;;
>   *)
>         N=/etc/init.d/$NAME
>         # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
>         echo "Usage: $N {start|stop|restart|force-reload}" >&2
>         exit 1
>         ;;
> esac
>
> exit 0
> ##############################################################################
>
>
> --
> Steve
>

Thanks everyone who answered this. My backend now starts as I want it.





More information about the mythtv-users mailing list