提交 2f9fff92 编写于 作者: R Reynald Borer 提交者: Kohsuke Kawaguchi

[JENKINS-11306] Debian init script: return a proper status code when Jenkins is not running.

上级 3b8d2871
......@@ -61,6 +61,9 @@ Upcoming changes</a>
<li class=bug>
java.io.IOException: Unexpected termination of the channel - SEVERE: I/O error in channel Chunked connection when using jenkins-cli.jar (works on older Hudson version)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-11130">issue 11130</a>)
<li class=bug>
Debian init script now returns the proper exit code from the 'status' command.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-11306">issue 11306</a>)
<li class=rfe>
Sortable table wasn't "stable" when there are same values in different rows
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-11551">issue 11551</a>)
......
......@@ -205,27 +205,35 @@ case "$1" in
esac
;;
status)
get_daemon_status
case "$?" in
0) echo "$DESC is running with the pid `cat $PIDFILE`";;
*)
get_running
procs=$?
if [ $procs -eq 0 ]; then
echo -n "$DESC is not running"
if [ -f $PIDFILE ]; then
echo ", but the pidfile ($PIDFILE) still exists"
else
echo
fi
else
echo "$procs instances of jenkins are running at the moment"
echo "but the pidfile $PIDFILE is missing"
fi
;;
esac
;;
get_daemon_status
case "$?" in
0)
echo "$DESC is running with the pid `cat $PIDFILE`"
rc=0
;;
*)
get_running
procs=$?
if [ $procs -eq 0 ]; then
echo -n "$DESC is not running"
if [ -f $PIDFILE ]; then
echo ", but the pidfile ($PIDFILE) still exists"
rc=1
else
echo
rc=3
fi
else
echo "$procs instances of jenkins are running at the moment"
echo "but the pidfile $PIDFILE is missing"
rc=0
fi
exit $rc
;;
esac
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}" >&2
exit 3
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册