diff options
author | Francesco Colista <fcolista@alpinelinux.org> | 2017-07-13 10:22:55 +0000 |
---|---|---|
committer | Francesco Colista <fcolista@alpinelinux.org> | 2017-07-13 10:23:00 +0000 |
commit | b3035afd9af9784996e38362dd5ded3c6c4e0cab (patch) | |
tree | c6fabaaf8c7d5d8e11f7f7bb36021321d30e9cbd /testing/jenkins/jenkins.initd | |
parent | 5e4b96e23871ee28ef593b439f8c07ca7c7eb5bb (diff) | |
download | aports-b3035afd9af9784996e38362dd5ded3c6c4e0cab.tar.bz2 aports-b3035afd9af9784996e38362dd5ded3c6c4e0cab.tar.xz |
testing/jenkins:new aport
Diffstat (limited to 'testing/jenkins/jenkins.initd')
-rw-r--r-- | testing/jenkins/jenkins.initd | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/testing/jenkins/jenkins.initd b/testing/jenkins/jenkins.initd new file mode 100644 index 0000000000..7520edabbd --- /dev/null +++ b/testing/jenkins/jenkins.initd @@ -0,0 +1,53 @@ +#!/sbin/openrc-run + +depend() { + need net + use dns logger mysql postgresql +} + +checkconfig() { + if [ ! -n "$JENKINS_HOME" ] ; then + eerror "JENKINS_HOME not configured" + return 1 + fi + if [ ! -d "$JENKINS_HOME" ] ; then + checkpath -q -d -o jenkins:jenkins -m 0755 "$JENKINS_HOME" || return 1 + fi + return 0 +} + +start() { + checkconfig || return 1 + + JAVA_HOME="/usr/lib/jvm/default-jvm" + COMMAND=$JAVA_HOME/bin/java + + JAVA_PARAMS="$JENKINS_JAVA_OPTIONS -DJENKINS_HOME=$JENKINS_HOME -jar $JENKINS_WAR" + + # Don't use --daemon here, because in this case stop will not work + PARAMS="--logfile=/var/log/jenkins/jenkins.log" + [ -n "$JENKINS_PORT" ] && PARAMS="$PARAMS --httpPort=$JENKINS_PORT" + [ -n "$JENKINS_DEBUG_LEVEL" ] && PARAMS="$PARAMS --debug=$JENKINS_DEBUG_LEVEL" + [ -n "$JENKINS_HANDLER_STARTUP" ] && PARAMS="$PARAMS --handlerCountStartup=$JENKINS_HANDLER_STARTUP" + [ -n "$JENKINS_HANDLER_MAX" ] && PARAMS="$PARAMS --handlerCountMax=$JENKINS_HANDLER_MAX" + [ -n "$JENKINS_HANDLER_IDLE" ] && PARAMS="$PARAMS --handlerCountMaxIdle=$JENKINS_HANDLER_IDLE" + [ -n "$JENKINS_ARGS" ] && PARAMS="$PARAMS $JENKINS_ARGS" + + if [ "$JENKINS_ENABLE_ACCESS_LOG" = "yes" ]; then + PARAMS="$PARAMS --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/log/jenkins/access_log" + fi + + ebegin "Starting ${SVCNAME}" + start-stop-daemon --start --quiet --background \ + --make-pidfile --pidfile $JENKINS_PIDFILE \ + --user ${JENKINS_USER} \ + --exec "${COMMAND}" -- $JAVA_PARAMS $PARAMS + eend $? +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon --stop --quiet --pidfile $JENKINS_PIDFILE + eend $? +} + |