summaryrefslogtreecommitdiff
blob: ad8ef9f74f90b28002016f6503c8237c5d19e2db (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
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-servers/resin/files/3.2.1/resin.init,v 1.1 2009/02/02 23:31:58 nelchael Exp $

depend() {
	need net
	use dns logger mysql postgresql
}

runResin() {

	JAVA_HOME=$(java-config -O)
	[ -n "${GENTOO_VM}" ] && JAVA_HOME=$(java-config --select-vm="${GENTOO_VM}" -O)
	export JAVA_HOME

	local extraArgs=
	if [ "${VERBOSE}" = "yes" ]; then
		extraArgs="-verbose"
	fi

	local msg="${1}"
	shift

	local cmdline="${JAVA_HOME}/bin/java -jar /usr/share/resin/lib/resin.jar -conf /etc/resin/resin.conf -resin-home __RESIN_HOME__ -root-directory __RESIN_HOME__ ${extraArgs} ${@}"

	ebegin "${msg}"
	su - resin -c "${cmdline}"
	eend $?

}

start()	{

	runResin "Starting Resin" "start"

}

stop()	{

	runResin "Stopping Resin" "stop"

}