#!/sbin/runscript # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License, v2 or later # $Header: $ depend() { need net } start() { 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 eend $? } stop() { ebegin "Stopping artifactory" start-stop-daemon --stop --quiet --pidfile /var/run/artifactory.pid eend $? }