summaryrefslogtreecommitdiff
path: root/pcr/openrc-devel/jenkins.initd
diff options
context:
space:
mode:
Diffstat (limited to 'pcr/openrc-devel/jenkins.initd')
-rw-r--r--pcr/openrc-devel/jenkins.initd38
1 files changed, 38 insertions, 0 deletions
diff --git a/pcr/openrc-devel/jenkins.initd b/pcr/openrc-devel/jenkins.initd
new file mode 100644
index 000000000..de15a76c2
--- /dev/null
+++ b/pcr/openrc-devel/jenkins.initd
@@ -0,0 +1,38 @@
+#!/usr/bin/openrc-run
+
+
+JENKINS_PIDFILE=/run/jenkins.pid
+ARGS="$JAVA_ARGS $JAVA_OPTS -jar $JENKINS_WAR $JENKINS_WEBROOT $JENKINS_PORT $JENKINS_AJPPORT $JENKINS_OPTS"
+
+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
+
+ ebegin "Starting ${SVCNAME}"
+ start-stop-daemon --start --quiet --background \
+ --make-pidfile --pidfile $JENKINS_PIDFILE \
+ --user ${JENKINS_USER} \
+ --exec "${JAVA}" -- ${ARGS}
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping ${SVCNAME}"
+ start-stop-daemon --stop --quiet --pidfile $JENKINS_PIDFILE
+ eend $?
+}