I have struggled with that one myself so here is my script. I have
adapted it from some other script that are posted here but that didn't
work on SUSE.

Been using them on suse 10 and suse 10.1 for a while. I think the stop
bit doesn't work but the start definitely works.

slimserverinit script to put in /etc/rc.d

then use yast to make it load automatically for runlevel 5

#!/bin/sh
#
# slimserver.init  This shell script takes care of starting and
stopping
#             the Slim streaming MP3 server.
#
# chkconfig: 345 80 30
# description: Slim streaming MP3 server
# processname: slimserver.pl
# config: /etc/slimserver.conf


if [ -f /etc/sysconfig/slimserver ]; then
        . /etc/sysconfig/slimserver
fi

. /etc/rc.status
rc_reset

RETVAL=0
prog="SLIMSERVER"

SLIMSERVER_BIN="$SLIMSERVER_HOME/slimserver.pl"

[ -x $SLIMSERVER_BIN -a -f $SLIMSERVER_CFG ] || RETVAL=5

case "$1" in
        start)
        echo -n "Starting SlimServer: "
checkproc -p ${PID_FILE} ${SLIMSERVER_BIN}
case $? in
0) echo -n "- Warning: daemon already running.
" ;;
1) echo -n "- Warning: ${PID_FILE} exists. "
;;
esac
startproc -p ${PID_FILE} ${SLIMSERVER_BIN}
${SLIMSERVER_ARGS}
rc_status -v
;;



        stop) 
        echo -n "Shutting down SlimServer: "
        kill `pidof slimserver`
        rc_status -v
        ;;

status)
echo -n "Checking for slimserver daemon "
checkproc -p ${PID_FILE} ${SLIMSERVER_BIN}
rc_status -v
;;
esac
exit ${RETVAL}
--------------------------------------------------------------
==============================================================
cd /etc/sysconfig/slimserver

# Edit this to suit your setup
SLIMSERVER_USER="slimserver"
SLIMSERVER_HOME="/usr/local/slimserver"
SLIMSERVER_CFG="/etc/slimserver.conf"
SLIMSERVER_LOG="/tmp/slimserver.log"
SLIMSERVER_ARGS="--daemon --logfile=$SLIMSERVER_LOG --user
$SLIMSERVER_USER --group users --prefsfile=$SLIMSERVER_CFG --cachedir
/var/tmp/slimserver"
PID_FILE="/var/run/slimserver.pid"

the slimserver.conf file is generated by the slimserver so no need for
it.


-- 
dukeinlondon
------------------------------------------------------------------------
dukeinlondon's Profile: http://forums.slimdevices.com/member.php?userid=1145
View this thread: http://forums.slimdevices.com/showthread.php?t=23983

_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/unix

Reply via email to