diff options
author | Sven Gothel <[email protected]> | 2013-06-08 04:59:45 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2013-06-08 04:59:45 +0200 |
commit | ea8e82f8cb83a8732af7133d8ca0986af6717101 (patch) | |
tree | 8955d2b198e63b13f39ae908994de50d67160244 /jenkins-server-slave-setup/scripts/jenkins-initd-debian | |
parent | 457686729b0fbebfe6b242165ba9e1679604ae84 (diff) |
Updated jenkins start/init scripts. Align our debian init script w/ the one we used for redhat
Diffstat (limited to 'jenkins-server-slave-setup/scripts/jenkins-initd-debian')
-rwxr-xr-x | jenkins-server-slave-setup/scripts/jenkins-initd-debian | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/jenkins-server-slave-setup/scripts/jenkins-initd-debian b/jenkins-server-slave-setup/scripts/jenkins-initd-debian new file mode 100755 index 0000000..3b5fa5c --- /dev/null +++ b/jenkins-server-slave-setup/scripts/jenkins-initd-debian @@ -0,0 +1,83 @@ +#! /bin/bash +### BEGIN INIT INFO +# Provides: jenkins +# Required-Start: $local_fs $remote_fs $network $syslog $time +# Required-Stop: $local_fs $remote_fs $network $syslog +# Should-Start: apache2 +# Should-Stop: +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Jenkins init script. +# Description: Init script for Jenkins, a Continuous Integration server. +### END INIT INFO + +# +# jenkins Start/Stop the Jenkins Continuous Integration server. +# +# chkconfig: 345 91 10 +# description: Jenkins is a Continuous Integration server. \ +# processname: jenkins +# pidfile: /var/run/jenkins.pid + + +# Source function library. +. /lib/lsb/init-functions + +# Check that networking is up. +# [ "${NETWORKING}" = "no" ] && exit 0 + +JENKINS_USER=jogamp_ci +JENKINS_HOME=/srv/jenkins +startup=$JENKINS_HOME/scripts/start.jenkins.sh +shutdown=$JENKINS_HOME/scripts/stop.jenkins.sh +export JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:bin/javac::") + +start(){ + echo -n $"Starting Jenkins service: " + su - $JENKINS_USER -c $startup + RETVAL=$? + echo +} + +stop(){ + action $"Stopping Jenkins service: " + su - $JENKINS_USER -c $shutdown + RETVAL=$? + echo +} + +status(){ + numproc=`ps -ef | grep jenkins.war | grep -v "grep jenkins.war" | wc -l` + if [ $numproc -gt 0 ]; then + echo "Jenkins is running..." + else + echo "Jenkins is stopped..." + fi +} + +restart(){ + stop + start +} + + +# See how we were called. +case "$1" in +start) + start + ;; +stop) + stop + ;; +status) + status + ;; +restart) + restart + ;; +*) + echo $"Usage: $0 {start|stop|status|restart}" + exit 1 +esac + +exit 0 |