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

GentooInitD

From SqueezeboxWiki

Revision as of 05:10, 29 June 2010 by Soulkeeper (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
#!/sbin/runscript
# Init script for SlimServer 5/6 for Gentoo Linux
# Save this as /etc/init.d/slimserver.
# Don't forget to issue 'rc-update add slimserver default' to
# have it restart at boot time. Remember to add user to system.
# David

depend() {
        need net
        after localmount
}

# Configure these appropriately for the local installation
pidfile=/var/run/slimserver/slimserver.pid
logfile=/var/log/slimserver/messages
ssdir=/usr/local/slimservercachedir=/var/cache/slimserver
niceness=-10

start() {
        ebegin "Starting Slimserver"
        HOME=${ssdir} /bin/nice --adjustment=${niceness} start-stop-daemon \
        	--start --quiet \
		--exec ${ssdir}/slimserver.pl -- --daemon \
		--prefsfile=/etc/slimserver.pref --cachedir=${cachedir} \
		--pidfile=${pidfile} --user=slim \
		--logfile=${logfile} ${SLIMSERVER_OPTS}
        eend $? "Failed to start Slimserver"
}

stop() {
        ebegin "Stopping Slimserver"
        start-stop-daemon --stop --quiet --pidfile ${pidfile}

        # In the case of misconfiguration use linux's 'killall'.
        killall slimserver.pl

        eend $? "Failed to stop Slimserver"
}