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

SUSE 10.1 startup scripts

From SqueezeboxWiki

Jump to: navigation, search

Hi, based on this thread http://forums.slimdevices.com/showpo...88&postcount=8 i corrected the script, so that the shutdown of the slimserver works with ./slimserver.init stop

Installation: Download the version 6.3.1 rpm of the slimserver an install it on the Suse 10.1.

log in as root an copy the scripte in the directories. In the directory /etc/init.d copy the file slimserver.init and in the directory /etc/sysconfig the file slimverver. Do not forget to set to set the "Is executable" flag after the copying slimserver.init (right mouse click "Properties" -> "Permissions" then set "Is executable"). you only have to copy the file "slimserver" in its directory. This file is not executable, so you do not set the flag.

Please have a look, that you use the standart paths: /etc/slimserver.conf for the configuration and /usr/local/slimserver for the server itself. But this should be right if you installed the rpm. The user "slimserver" with the group "slimserver" should also installed by the rpm. If it is not you can generate it with YAST and set write permission for /usr/local/slimserver and /etc/slimserver.conf.

After a check of all permissions you can start/stop the slimserver an check the status

change into /etc/init.d:...cd etc/init.dstart the slimserver:./slimserver.init startcheck the status of the slimserver:./slimserver.init statusstop the slimserver:./slimserver.init stopcheck the status of the slimserver again:./slimserver.init status

Now start YAST an start the Runlevel-Editor (you find it under "System"). click on the service "slimserver.init" an use the "expert mode" then set runlevel 5 for this service then start the service below. you should get a message that it works now.

Here is the script for the file slimserver.init that sould be copie into /etc/init.d and set the "is executable" flag. ATTENTION: on the end of the files there must be an ENTER, so that the last line is empty, else it may be, that Linux will not execute the last line!:

#!/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.confif [ -f /etc/sysconfig/slimserver ]; then. /etc/sysconfig/slimserverfi. /etc/rc.statusrc_resetRETVAL=0prog="SLIMSERVER"SLIMSERVER_BIN="$SLIMSERVER_HOME/slimserver.pl"[ -x $SLIMSERVER_BIN -a -f $SLIMSERVER_CFG ] || RETVAL=5case "$1" instart)echo -n "Starting SlimServer: "checkproc -p ${PID_FILE} ${SLIMSERVER_BIN}case $? in0) echo -n "- Warning: daemon already running. " ;;1) echo -n "- Warning: ${PID_FILE} exists. " ;;esacstartproc -n ${NICE_VALUE} -p ${PID_FILE} ${SLIMSERVER_BIN} ${SLIMSERVER_ARGS}rc_status -v;;stop)echo -n "Shutting down SlimServer: "kill `pidof -x slimserver.pl`rc_status -v;;status)echo -n "Checking for slimserver daemon "checkproc -p ${PID_FILE} ${SLIMSERVER_BIN}rc_status -v;;esacexit ${RETVAL}

Here the script for the file slimserver that you must copy into /etc/sysconfig/ :

# Edit this to suit your setupSLIMSERVER_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"NICE_VALUE="-3"

Edit Aug 28. 2006: For a better response and less interruption of the audio stream in heavy load sitations of the server that runs the slimserver i added the nice option in the config files to set a higher priority for the slimserver. For a better response set a value less than 0 in the file "slimserver" located in /etc/sysconfig/. I set a value of -3 for the NICE_VALUE wich should be enough or try -5 if you have problems (min value is -20 for the nice value, but don't do that!). If you don't want a higher priority set NICE_VALUE="0". In the attachement you find the new scripts that are already supplemented with the parameter "NICE_VALUE".

have a lot of fun :-)))), please have a look in the german forum where i described it also in german and sorry for my english. suseslim

Edit 2007-02-13: Based on the instructions above, here is a summary with a couple more details:

Install SlimServer 6.3.1 on Suse 10:

Download and install RPM: http://www.slimdevices.com/downloads/

Download the files for /etc/sysconfig/slimserver' and '/etc/init.d/slimserver.init': SUSE101StartupScripts

Make 'slimserver.init' executable.

The RPM adds a group and user called 'slimserver', and this user is the owner of the '/usr/local/slimserver' directory. You need to make this user and group the owner of '/var/tmp/slimserver'.

Check the log if you have any problems starting the server (using '/etc/init.d/slimserver.init start'. If no problems, use the runlevel editor to automatically start the server.

JT

Edit 2007-02-14:

Here is how to upgrade to 6.5.1 from 6.3.1 running on Suse 10:

uninstall slimserver 6.3.1: rpm -e slimserver

download SlimServer 6.5.1 rpm from slimdevices

install slimserver 6.5.1: rpm -i SlimServer_v6.5.1.noarch.rpm

Restore your functional configuration files:

cd /etc

mv slimserver.conf slimserver.conf.6.5.1

mv slimserver.conf.rpmsave slimserver.conf

cd sysconfig

mv slimserver slimserver.6.5.1

mv slimserver.rpmsave slimserver

Make sure the slimserver user is the owner of '/etc/slimserver.log', '/var/tmp/slimserver' and '/usr/local/slimserver'

Restart slimserver using the slimserver.init script

rm the '/etc/slimserver.conf.6.5.1' and '/etc/sysconfig/slimserver.6.5.1' files. JT