diff options
Diffstat (limited to 'dev-util/jenkins-bin/files')
-rw-r--r-- | dev-util/jenkins-bin/files/jenkins-bin-r1.confd | 52 | ||||
-rw-r--r-- | dev-util/jenkins-bin/files/jenkins-bin-r3.init | 50 | ||||
-rw-r--r-- | dev-util/jenkins-bin/files/jenkins-bin-r3.service | 2 | ||||
-rw-r--r-- | dev-util/jenkins-bin/files/jenkins-bin-r4.service | 11 |
4 files changed, 114 insertions, 1 deletions
diff --git a/dev-util/jenkins-bin/files/jenkins-bin-r1.confd b/dev-util/jenkins-bin/files/jenkins-bin-r1.confd new file mode 100644 index 000000000000..6bb38f3e6ce3 --- /dev/null +++ b/dev-util/jenkins-bin/files/jenkins-bin-r1.confd @@ -0,0 +1,52 @@ +# Config file for /etc/init.d/jenkins + +# +# Directory where Jenkins store its configuration and working +# files (checkouts, build reports, artifacts, ...). +# +JENKINS_HOME="/var/lib/jenkins/home" + +# +# Options to pass to java when running Jenkins. +# +JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true" + +# +# Port Jenkins is listening on. +# +JENKINS_PORT="8080" + +# +# Debug level for logs -- the higher the value, the more verbose. +# 5 is INFO. +# +JENKINS_DEBUG_LEVEL="5" + +# +# Whether to enable access logging or not. +# +JENKINS_ENABLE_ACCESS_LOG="no" + +# +# Pass arbitrary arguments to Jenkins. +# Eg.: --httpListenAddress=127.0.0.1 --prefix=/jenkins +# Full option list: java -jar jenkins.war --help +# +JENKINS_ARGS="" + +# +# User +# +JENKINS_USER=jenkins + + + +# +# Pid File +# +JENKINS_PIDFILE="/var/run/jenkins.pid" + +# +# War File +# +JENKINS_WAR="/opt/jenkins/jenkins.war" diff --git a/dev-util/jenkins-bin/files/jenkins-bin-r3.init b/dev-util/jenkins-bin/files/jenkins-bin-r3.init new file mode 100644 index 000000000000..96ddbc1fd421 --- /dev/null +++ b/dev-util/jenkins-bin/files/jenkins-bin-r3.init @@ -0,0 +1,50 @@ +#!/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=`java-config --jre-home` + 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_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 $? +} diff --git a/dev-util/jenkins-bin/files/jenkins-bin-r3.service b/dev-util/jenkins-bin/files/jenkins-bin-r3.service index 520a052f43f1..dfe0d174f365 100644 --- a/dev-util/jenkins-bin/files/jenkins-bin-r3.service +++ b/dev-util/jenkins-bin/files/jenkins-bin-r3.service @@ -4,7 +4,7 @@ Description=Jenkins Daemon [Service] EnvironmentFile=/etc/conf.d/jenkins Type=simple -ExecStart=/usr/bin/java ${JENKINS_JAVA_OPTIONS} -DJENKINS_HOME=${JENKINS_HOME} -jar ${JENKINS_WAR} --daemon --logfile=/var/log/jenkins/jenkins.log --httpPort=${JENKINS_PORT} --debug=${JENKINS_DEBUG_LEVEL} --handlerCountMax=100 --handlerCountMaxIdle=20 --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/log/jenkins/access_log ${JENKINS_ARGS} +ExecStart=/usr/bin/java ${JENKINS_JAVA_OPTIONS} -DJENKINS_HOME=${JENKINS_HOME} -jar ${JENKINS_WAR} --daemon --logfile=/var/log/jenkins/jenkins.log --httpPort=${JENKINS_PORT} --debug=${JENKINS_DEBUG_LEVEL} --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/log/jenkins/access_log ${JENKINS_ARGS} User=jenkins [Install] diff --git a/dev-util/jenkins-bin/files/jenkins-bin-r4.service b/dev-util/jenkins-bin/files/jenkins-bin-r4.service new file mode 100644 index 000000000000..520a052f43f1 --- /dev/null +++ b/dev-util/jenkins-bin/files/jenkins-bin-r4.service @@ -0,0 +1,11 @@ +[Unit] +Description=Jenkins Daemon + +[Service] +EnvironmentFile=/etc/conf.d/jenkins +Type=simple +ExecStart=/usr/bin/java ${JENKINS_JAVA_OPTIONS} -DJENKINS_HOME=${JENKINS_HOME} -jar ${JENKINS_WAR} --daemon --logfile=/var/log/jenkins/jenkins.log --httpPort=${JENKINS_PORT} --debug=${JENKINS_DEBUG_LEVEL} --handlerCountMax=100 --handlerCountMaxIdle=20 --accessLoggerClassName=winstone.accesslog.SimpleAccessLogger --simpleAccessLogger.format=combined --simpleAccessLogger.file=/var/log/jenkins/access_log ${JENKINS_ARGS} +User=jenkins + +[Install] +WantedBy=multi-user.target |