summaryrefslogtreecommitdiff
blob: 23717c4ea30ae55bc0fcf2a88643a7e423b0ac9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/sbin/runscript
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/media-sound/squeezecenter/files/squeezecenter.init.d,v 1.1 2008/08/03 04:35:29 lavajoe Exp $

# These fit the SqueezeCenter ebuild and so shouldn't need to be changed;
# user-servicable parts go in /etc/conf.d/squeezecenter.
pidfile=/var/run/squeezecenter/squeezecenter.pid
logdir=/var/log/squeezecenter
varlibdir=/var/lib/squeezecenter
prefsdir=${varlibdir}/prefs
cachedir=${varlibdir}/cache
prefsfile=${prefsdir}/squeezecenter.prefs
scuser=squeezecenter
scname=squeezecenter-server

depend() {
	need net mysql
}

start() {
	ebegin "Starting SqueezeCenter"

	cd /
	/usr/bin/nice --adjustment=${SC_NICENESS:-0} sudo -u ${scuser} \
		start-stop-daemon \
			--start --exec /usr/bin/perl /usr/sbin/${scname} \
			-- \
			--quiet --daemon \
			--pidfile=${pidfile} \
			--cachedir=${cachedir} \
			--prefsfile=${prefsfile} \
			--prefsdir=${prefsdir} \
			--logdir=${logdir} \
			--audiodir=${SC_MUSIC_DIR} \
			--playlistdir=${SC_PLAYLISTS_DIR} \
			${SC_OPTS}

	eend $? "Failed to start SqueezeCenter"
}

stop() {
	ebegin "Stopping SqueezeCenter"
	start-stop-daemon -o --stop --pidfile ${pidfile}
	eend $? "Failed to stop SqueezeCenter"
}