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
|
2011-11-22 15:02:54 +01:00
|
|
|
CLASSPATH="$CLASSPATH:$JDBC_JAR"
|
2011-05-30 11:44:15 +02:00
|
|
|
|
2011-11-22 15:02:54 +01:00
|
|
|
start-stop-daemon --start --user ${ARTIFACTORY_USER:-artifact}:${ARTIFACTORY_GROUP:-artifact} \
|
|
|
|
--chdir "/var/lib/artifactory" \
|
2011-05-30 11:44:15 +02:00
|
|
|
--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 $?
|
|
|
|
}
|