<?sphp $this->text('pagetitle') ?>
 
Home of the Squeezebox™ & Transporter® network music players.

SUSE 9.3 startup scripts

From SqueezeboxWiki

Revision as of 15:02, 30 June 2010 by Soulkeeper (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

An example SuSE 9.3 startup script. Save it as /etc/rc.d/slimserver.

#!/bin/bash## /etc/rc.d/slimserverRETVAL=0prog="SLIMSERVER". /etc/sysconfig/slimservercd $SLIMSERVER_HOMESLIMSERVER_BIN="$SLIMSERVER_HOME/slimserver.pl"[ -x $SLIMSERVER_BIN ] || exit 5start() {       echo -n "Starting SlimServer: "       su - $SLIMSERVER_USER -c "$SLIMSERVER_BIN $SLIMSERVER_ARGS"       RETVAL=$?       echo       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/slimserver && echo "done"       return $RETVAL}stop() {       echo -n "Stopping SlimServer: "       killall slimserver.pl       RETVAL=$?       echo       [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/slimserver && echo "done"       return $RETVAL}# See how we were called.case "$1" in       start)             start             ;;       stop)             stop             ;;       restart|reload)             stop             start             RETVAL=$?             ;;       *)             echo "Usage: $0 {start|stop|restart}"             exit 1esacexit $RETVAL

An example settings file (edit to match the settings of your install, and save this as /etc/sysconfig/slimserver):

SLIMSERVER_USER="slimserver"SLIMSERVER_HOME="/home/slimserver"SLIMSERVER_CFG="${SLIMSERVER_HOME}/slimserver.conf"SLIMSERVER_LOG="/tmp/slimserver.log"SLIMSERVER_ARGS="--daemon --logfile=$SLIMSERVER_LOG"