Re: Start mythbackend in Jessie

Page principale

Répondre à ce message
Auteur: Janusz S. Bien
Date:  
À: Josu Lazkano
CC: Guillaume Membré, dmo-discussion@deb-multimed...
Sujet: Re: Start mythbackend in Jessie
Quote/Cytat - Josu Lazkano <josu.lazkano@???> (Sat 21 Mar 2015
03:40:48 PM CET):

> Thanks both,
>
> This is my first time with "service mythbackend", I always use
> "/etc/init.d/mythbackend". Here is the file content:
>
> # cat /etc/default/mythtv-backend
> # User as which to run
> #USER=mythtv
>
> # Replace all arguments to mythtvbackend
> #ARGS=""
>
> # Append additional arguments
> #EXTRA_ARGS="--verbose"
>
> # Set priority
> #NICE=-10


I use MythTV "out of the box" - just installed the Debian packages. At
first I had some problems with the database password, but I haven't
modified any other setting.

The content of my file is quite different and much more complicated.

I enclose the file.

Regards

Janusz

--
Prof. dr hab. Janusz S. Bień - Uniwersytet Warszawski (Katedra
Lingwistyki Formalnej)
Prof. Janusz S. Bień - University of Warsaw (Formal Linguistics Department)
jsbien@???, jsbien@???, http://fleksem.klf.uw.edu.pl/~jsbien/#! /bin/sh
### BEGIN INIT INFO
# Provides:          mythtv-backend
# Required-Start:    $local_fs $remote_fs
# Required-Stop:     $local_fs $remote_fs
# Should-Start:      mysql
# Should-Stop:       mysql
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# X-Interactive:     true
# Short-Description: Start/Stop the MythTV server.
### END INIT INFO


if [ -f /etc/default/locale ]; then
. /etc/default/locale
export LANG
fi

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

. /lib/lsb/init-functions

set -e

USER=mythtv
RUNDIR=/var/run/mythtv
ARGS="--daemon --syslog local6 --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

unset DISPLAY
unset SESSION_MANAGER

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 --retry 10 --pidfile $RUNDIR/$NAME.pid \
                --chuid $USER --exec $DAEMON -- $ARGS
    echo "."
    start-stop-daemon --start --pidfile $RUNDIR/$NAME.pid \
                --chuid $USER --nicelevel $NICE --exec $DAEMON -- $ARGS
    echo "."
    ;;
  reload)
      start-stop-daemon --stop --oknodo --signal HUP --pidfile \
      $RUNDIR/$NAME.pid --chuid $USER --exec $DAEMON -- $ARGS
      echo "."
      ;;
  *)
    N=/etc/init.d/$NAME
    echo "Usage: $N {start|stop|restart|force-reload}" >&2
    exit 1
    ;;
esac


exit 0