mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-19 11:41:26 +00:00
Make "/etc/init.d/scst status" exit with code 3 instead of 0 if SCST has not been started as required by the LSB (merge r4047 from trunk).
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@4048 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -82,6 +82,20 @@ SCST_CFG=/etc/scst.conf
|
||||
|
||||
if [ ! -e /lib/lsb/init-functions ]; then
|
||||
# Slackware / Gentoo.
|
||||
rc_status() {
|
||||
_rc_status_ret=$?
|
||||
for i; do
|
||||
case "$i" in
|
||||
-v)
|
||||
case "${_rc_status_ret}" in
|
||||
0) echo "OK";;
|
||||
*) echo "Not running";;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
done
|
||||
return ${_rc_status_ret}
|
||||
}
|
||||
start_daemon() {
|
||||
"$@" >/dev/null 2>&1 &
|
||||
}
|
||||
@@ -314,14 +328,9 @@ case "$1" in
|
||||
status)
|
||||
## Print the current status of the service.
|
||||
echo -n "SCST status: "
|
||||
scst_status
|
||||
rc=$?
|
||||
if [ $rc = 0 ]; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "Not running"
|
||||
fi
|
||||
exit 0
|
||||
scst_status >/dev/null 2>&1
|
||||
rc_status -v
|
||||
exit $?
|
||||
;;
|
||||
*)
|
||||
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
|
||||
|
||||
Reference in New Issue
Block a user