Skip to content
Permalink
Browse files
[FIXED JENKINS-5020] OpenSUSE init script fix.
Originally-From: jenkins-ci.org/commit/core/0c1966657f3e5b932bec88e59274aed448bddce7
  • Loading branch information
kohsuke committed Feb 11, 2011
1 parent 3a80ebe commit b5b5677d9c47e77c84046b363175305b52ffab48
Showing with 3 additions and 25 deletions.
  1. +3 −25 SOURCES/jenkins.init.in
@@ -91,35 +91,13 @@ fi
case "$1" in
start)
echo -n "Starting Jenkins "
if /sbin/startproc -l /var/log/jenkins.rc -u "$JENKINS_USER" -p "$JENKINS_PID_FILE" $JAVA_CMD $PARAMS; then
rc_status
# get own session ID
MY_SESSION_ID=`/bin/ps h -o sess -p $$`
# get PID
/bin/ps hww -u hudson -o sess,pid,cmd | grep java | grep -i jenkins | \
while read sess pid cmd; do [ "$sess" = $MY_SESSION_ID ] && echo $pid; done | \
head -1 > "$JENKINS_PID_FILE"
else
rc_failed 1
fi
JPID=`/sbin/startproc -v -s -l /var/log/jenkins.rc -u "$JENKINS_USER" -p "$JENKINS_PID_FILE" $JAVA_CMD $PARAMS`
rc_status -v
[ -s "$JENKINS_PID_FILE" ] || echo $JPID >"$JENKINS_PID_FILE"
;;
stop)
echo -n "Shutting down Jenkins "
PID=`cat "$JENKINS_PID_FILE" 2>/dev/null`
if [ -n "$PID" ]; then
if /bin/kill -0 "$PID"; then
# process exists
/bin/kill -INT "$PID"
rc=$?
[ "$rc" = "0" ] && /bin/rm -f "$JENKINS_PID_FILE"
rc_failed "$rc"
else
rc_failed 7
fi
else
rc_failed 1
fi
/sbin/killproc -p "$JENKINS_PID_FILE" $JAVA_HOME/bin/java
rc_status -v
;;
try-restart|condrestart)

0 comments on commit b5b5677

Please sign in to comment.