summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'www-servers/resin/files/4.0.9/resin.init')
-rw-r--r--www-servers/resin/files/4.0.9/resin.init37
1 files changed, 37 insertions, 0 deletions
diff --git a/www-servers/resin/files/4.0.9/resin.init b/www-servers/resin/files/4.0.9/resin.init
new file mode 100644
index 000000000000..e6ec67cf3708
--- /dev/null
+++ b/www-servers/resin/files/4.0.9/resin.init
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/www-servers/resin/files/4.0.9/resin.init,v 1.1 2010/08/19 19:31:25 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.xml -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" "shutdown"
+}