Script for init.d on debian for myth
#! /bin/sh # # Starts the mythbackend as a daemon (Debian version) # # Copyright (c) 2003 by Simon Kenyon# # With thanks to: # Miquel van Smoorenburg # Ian Murdock # Michael Thomson # Stu Tomlinson # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin NAME=mythbackend DAEMON=/usr/bin/mythbackend LOGFILE="/var/log/$NAME.log" test -x $DAEMON || exit 0 case "$1" in start) echo -n "Starting: $NAME" start-stop-daemon --start --quiet --make-pidfile --pidfile \ /var/run/$NAME.pid --background --exec $DAEMON -- -l ${LOGFILE} echo "." ;; stop) echo -n "Stopping: $NAME" start-stop-daemon --stop --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON rm -f /var/run/$NAME.pid echo "." ;; restart) echo -n "Restarting: $NAME" start-stop-daemon --stop --quiet --pidfile \ /var/run/$NAME.pid --exec $DAEMON rm -f /var/run/$NAME.pid sleep 1 start-stop-daemon --start --quiet --make-pidfile --pidfile \ /var/run/$NAME.pid --background --exec $DAEMON -- -l ${LOGFILE} echo "." ;; *) N=/etc/init.d/${NAME} echo "Usage: $N {start|stop|restart}" >&2 exit 1 ;; esac exit 0