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

38 lines
833 B
Plaintext
Raw Normal View History

2011-05-30 09:18:46 +02:00
#!/sbin/runscript
# Installed in /etc/init.d/artifactory
export JAVA_HOME=/etc/java-config-2/current-system-vm
export PATH=$JAVA_HOME/bin:$PATH
DESC="Artifactory Maven Artifact Server"
NAME=artifactory
PIDFILE=/var/run/$NAME.pid
RUN_AS=artifact
ARTIFACTORY_HOME=/opt/artifact/artifactory
COMMAND=$ARTIFACTORY_HOME/bin/artifactory.init
ARGS="$ARTIFACTORY_HOME/etc/jetty.xml"
LOGFILE="$ARTIFACTORY_HOME/logs/consoleout.log"
depend() {
use net
after logger
}
start() {
ebegin "Starting $DESC"
start-stop-daemon --start --verbose --background --make-pidfile --pidfile $PIDFILE\
--chdir $ARTIFACTORY_HOME --chuid $RUN_AS --exec $COMMAND -- $ARGS > $LOGFILE 2>&1
eend $?
}
stop() {
ebegin "Stopping $DESC"
start-stop-daemon --stop --quiet --pidfile $PIDFILE
if [ -e $PIDFILE ]
then
rm $PIDFILE
fi
eend $?
}