[mythtv-users] Cannot run mythbackend with init.d script - runs fine at command prompt.

Chad masterclc at gmail.com
Sat Sep 30 21:03:06 UTC 2006


On 9/30/06, drbob <drbob at gmx.co.uk> wrote:
> Chad wrote:
> > We used to have this problem on Gentoo as well.  Can you post your
> > init script?  Off hand I cannot remember exactly the problem (or the
> > fix) but it had to do with chaning the $HOME variable IIRC.  (possibly
> > /var/lib/mythtv or /etc/mythtv..?).
> >
> > -Chad
> >
> Here is the init script:
>
> #! /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/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/default/mythtv-backend ]; then
>   . /etc/default/mythtv-backend
> fi
>
> ARGS="$ARGS $EXTRA_ARGS"
>
> mkdir -p $RUNDIR
> chown -R $USER $RUNDIR
>
>
> case "$1" in
>   start)
>         if test -e $RUNDIR/$NAME.pid ; then
>                 echo "mythbackend already running, use restart instead."
>         else
>                 echo -n "Starting $DESC: $NAME"
>                 start-stop-daemon --start --pidfile $RUNDIR/$NAME.pid \
>                         --chuid $USER --nicelevel $NICE --exec $DAEMON
> -- $ARGS
>                 echo "."
>         fi
>         ;;
>   stop)
>         echo -n "Stopping $DESC: $NAME "
>         start-stop-daemon --stop --oknodo --pidfile $RUNDIR/$NAME.pid \
>                 --chuid $USER --exec $DAEMON -- $ARGS
>         test -e $RUNDIR/$NAME.pid && rm $RUNDIR/$NAME.pid
>         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|force-reload}" >&2
>         exit 1
>         ;;
> esac
>
> exit 0
>
> _______________________________________________

The option that looks like the 'culprit' to me is:

RUNDIR=/var/run/mythtv

So you'll want to have your mysql.txt file in that directory (you can
copy from ~/.mythtv/).  If it gets overwritten (which it looks like it
does), it looks like the script will also look in /etc/mythtv for a
file called mythtv-backend, where I assume you would place your
mysql.txt file.  You could make it really ugly and do something like
EXTRA_ARGS="cp /etc/mythtv/mysql.txt /var/run/mythtv/"

Assuming nothing else works.

Of course, the best option is to see what /etc/mythtv/mythtv-backend
has in it (if it even exists) to see if there is something you can set
in there.

Good luck!

-Chad

-- 
Prebuilt HDTV capable systems at reasonable prices:
http://www.pauselivetv.com


More information about the mythtv-users mailing list