Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:bmwiedemann:java
jenkins-swarm-client
jenkins-swarm-client.init
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File jenkins-swarm-client.init of Package jenkins-swarm-client
#!/bin/sh # # SUSE system statup script for Jenkins Swarm Client # Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany. # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or (at # your option) any later version. # # This library is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301, # USA # ### BEGIN INIT INFO # Provides: jenkins-swarm-client # Required-Start: $local_fs $remote_fs $network $named # Should-Start: $time sendmail # Required-Stop: $local_fs $remote_fs $network $named # Should-Stop: $time sendmail # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: Jenkins Swarm Client # Description: Add host to as swarm node to a jenkins instance ### END INIT INFO # Check for missing binaries (stale symlinks should not happen) JENKINS_JAR="/usr/lib/jenkins-swarm-client/jenkins-swarm-client.jar" test -r "$JENKINS_JAR" || { echo "$JENKINS_JAR not installed"; if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } # Check for existence of needed config file and read it JENKINS_CONFIG=/etc/sysconfig/jenkins-swarm-client test -r "$JENKINS_CONFIG" || { echo "$JENKINS_CONFIG not existing"; if [ "$1" = "stop" ]; then exit 0; else exit 6; fi; } JENKINS_PID_FILE="/var/run/jenkins-swarm-client.pid" # Read config . "$JENKINS_CONFIG" . /etc/rc.status rc_reset # Reset status of this service # ======= until here some changes, need more cleanup JAVA_CMD="/usr/bin/java $JENKINS_JAVA_OPTIONS -jar $JENKINS_JAR" case "$1" in start) echo -n "Starting Jenkins " /sbin/checkproc -k -p "$JENKINS_PID_FILE" "/usr/bin/java" CHECK=$? if [ $CHECK -eq 7 ]; then mkdir -p $JENKINS_HOME HOME=$JENKINS_HOME startproc -n $JENKINS_NICE -s -e -u "$JENKINS_USER" -p "$JENKINS_PID_FILE" $JAVA_CMD $PARAMS -labels "$LABELS" JPROC=$( find /proc -maxdepth 2 -user $JENKINS_USER -name exe -lname "*/bin/java" ) if [ -n "$JPROC" ]; then basename `dirname $JPROC` >"$JENKINS_PID_FILE" rc_status -v else rc_failed rc_status -v fi else rc_failed $CHECK rc_status -v fi ;; stop) echo -n "Shutting down Jenkins " /sbin/killproc -p "$JENKINS_PID_FILE" "/usr/bin/java" rm -f "$JENKINS_PID_FILE" rc_status -v ;; try-restart|condrestart) if test "$1" = "condrestart"; then echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}" fi $0 status if test $? = 0; then $0 restart else rc_reset # Not running is not a failure. fi rc_status ;; restart) $0 stop $0 start rc_status ;; force-reload) echo -n "Reload service Jenkins " $0 try-restart rc_status ;; reload) rc_failed 3 rc_status -v ;; status) echo -n "Checking for service Jenkins " /sbin/checkproc -p "$JENKINS_PID_FILE" "/usr/bin/java" rc_status -v ;; probe) ## Optional: Probe for the necessity of a reload, print out the ## argument to this init script which is required for a reload. ## Note: probe is not (yet) part of LSB (as of 1.9) test "$JENKINS_CONFIG" -nt "$JENKINS_PID_FILE" && echo reload ;; *) echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" exit 1 ;; esac rc_exit
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor