mirror of https://github.com/fail2ban/fail2ban
Merge pull request #36 from glennaaldering/patch-3
Provide informative exit codes upon exit of status. Debian policy is not specifying any and status command is optional, but LSB http://refspecs.linuxbase.org/LSB_3.1.1/LSB-Core-generic/LSB-Core-generic/iniscrptact.html does provide the desired onesdebian-devel
commit
f0da12e58b
|
@ -15,6 +15,8 @@
|
||||||
# Author: Aaron Isotton <aaron@isotton.com>
|
# Author: Aaron Isotton <aaron@isotton.com>
|
||||||
# Modified: by Yaroslav Halchenko <debian@onerussian.com>
|
# Modified: by Yaroslav Halchenko <debian@onerussian.com>
|
||||||
# reindented + minor corrections + to work on sarge without modifications
|
# reindented + minor corrections + to work on sarge without modifications
|
||||||
|
# Modified: by Glenn Aaldering <glenn@openvideo.nl>
|
||||||
|
# added exit codes for status command
|
||||||
#
|
#
|
||||||
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
PATH=/usr/sbin:/usr/bin:/sbin:/bin
|
||||||
DESC="authentication failure monitor"
|
DESC="authentication failure monitor"
|
||||||
|
@ -221,14 +223,14 @@ case "$command" in
|
||||||
255)
|
255)
|
||||||
check_socket
|
check_socket
|
||||||
case $? in
|
case $? in
|
||||||
1) log_warning_msg " $NAME is not running" ;;
|
1) log_warning_msg " $NAME is not running" && exit 3 ;;
|
||||||
0) log_failure_msg " $NAME is not running but $SOCKFILE exists" ;;
|
0) log_failure_msg " $NAME is not running but $SOCKFILE exists" && exit 3 ;;
|
||||||
2) log_failure_msg " $SOCKFILE not readable, status of $NAME is unknown";;
|
2) log_failure_msg " $SOCKFILE not readable, status of $NAME is unknown" && exit 3 ;;
|
||||||
3) log_failure_msg " $SOCKFILE exists but not a socket, status of $NAME is unknown";;
|
3) log_failure_msg " $SOCKFILE exists but not a socket, status of $NAME is unknown" && exit 3 ;;
|
||||||
*) report_bug "Unknown return code from $NAME:check_socket.";;
|
*) report_bug "Unknown return code from $NAME:check_socket." && exit 4 ;;
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
*) report_bug "Unknown $NAME status code"
|
*) report_bug "Unknown $NAME status code" && exit 4
|
||||||
esac
|
esac
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
Loading…
Reference in New Issue