alpha-quadrant/dev-java/artifactory/files/artifactory.initd

34 lines
1023 B
Plaintext
Raw Normal View History

2011-05-30 09:18:46 +02:00
#!/sbin/runscript
2011-05-30 11:44:15 +02:00
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License, v2 or later
# $Header: $
2011-05-30 09:18:46 +02:00
depend() {
2011-05-30 11:44:15 +02:00
need net
2011-05-30 09:18:46 +02:00
}
start() {
2011-05-30 11:44:15 +02:00
ebegin "Starting artifactory"
JAVACMD=$(java-config-2 -J)
JAVA_OPTIONS="$JAVA_OPTIONS -server -Djetty.home=$ARTIFACTORY_HOME -Dartifactory.home=$ARTIFACTORY_HOME -Dfile.encoding=UTF8"
LIB_DIR=$ARTIFACTORY_INSTALL/lib
CLASSPATH=$ARTIFACTORY_INSTALL/artifactory.jar
# Add all jars under the lib dir to the classpath
for i in $(ls $LIB_DIR/*.jar)
do
CLASSPATH="$CLASSPATH:$i"
done
start-stop-daemon --start --chuid ${ARTIFACTORY_USER:-artifact}:${ARTIFACTORY_GROUP:-artifact} \
-t --chdir "/var/lib/artifactory" \
--pidfile /var/run/artifactory.pid --make-pidfile --background \
--exec "$JAVACMD" -- $JAVA_OPTIONS -cp "$CLASSPATH" org.artifactory.standalone.main.Main
2011-05-30 09:18:46 +02:00
eend $?
}
stop() {
2011-05-30 11:44:15 +02:00
ebegin "Stopping artifactory"
start-stop-daemon --stop --quiet --pidfile /var/run/artifactory.pid
2011-05-30 09:18:46 +02:00
eend $?
}