diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-12-02 14:56:29 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-12-02 14:56:29 +0000 |
commit | cc2c9e975285d6fb1be1b71d18ba4cca7991b921 (patch) | |
tree | 9b90516b35ff9055066e5b8f2e4a2ce3b6a71b38 /dev-util/jenkins-bin/files/jenkins-bin-r3.init | |
parent | 5a1e5a6812ca9c9555657cce48fe09d2ffa44401 (diff) |
gentoo auto-resync : 02:12:2022 - 14:56:29
Diffstat (limited to 'dev-util/jenkins-bin/files/jenkins-bin-r3.init')
-rw-r--r-- | dev-util/jenkins-bin/files/jenkins-bin-r3.init | 50 |
1 files changed, 50 insertions, 0 deletions
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 $? +} |