diff options
author | Yaroslav Halchenko <debian@onerussian.com> | 2007-10-18 22:03:37 -0400 |
---|---|---|
committer | Yaroslav Halchenko <debian@onerussian.com> | 2007-10-18 22:03:37 -0400 |
commit | 2553e2717a86e73a4f1065ba1aa4af546463b798 (patch) | |
tree | 220ae343af09847a27d7db7e3afe7243dd68aa16 | |
parent | 8d9aca4e20049a5fab57991008a0be0f32190168 (diff) | |
download | fail2ban-debian/0.8.1-2.tar.gz |
* Added force-start action to init script, so it could be forceddebian/0.8.1-2
to start if previous run crashed and left a socket file. Must to be
used with caution.
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | debian/changelog | 7 | ||||
-rwxr-xr-x[-rw-r--r--] | debian/fail2ban.init | 16 |
3 files changed, 17 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..b25c15b8 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*~ diff --git a/debian/changelog b/debian/changelog index ed10c5e3..d9391055 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,11 @@ -fail2ban (0.8.1-2~pre1) UNRELEASED; urgency=low +fail2ban (0.8.1-2) unstable; urgency=low * Fixed named-refused filter. + * Added force-start action to init script, so it could be forced + to start if previous run crashed and left a socket file. Must to be + used with caution. - -- Yaroslav Halchenko <debian@onerussian.com> Tue, 14 Aug 2007 23:16:56 -0400 + -- Yaroslav Halchenko <debian@onerussian.com> Thu, 18 Oct 2007 18:31:58 -0400 fail2ban (0.8.1-1) unstable; urgency=low diff --git a/debian/fail2ban.init b/debian/fail2ban.init index e9685461..5522f53b 100644..100755 --- a/debian/fail2ban.init +++ b/debian/fail2ban.init @@ -94,7 +94,10 @@ do_start() if [ -e "$SOCKFILE" ]; then log_failure_msg "Socket file $SOCKFILE is present" - return 2 + [ "$1" == "force-start" ] \ + && log_success_msg "Starting anyway as requested" \ + || return 2 + DAEMON_ARGS="$DAEMON_ARGS -x" fi start-stop-daemon --start --quiet --chuid root --exec $DAEMON -- \ @@ -159,17 +162,20 @@ log_end_msg_wrapper() log_end_msg $value } -case "$1" in - start) +command="$1" +case "$command" in + start|force-start) [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" - do_start + do_start "$command" [ "$VERBOSE" != no ] && log_end_msg_wrapper $? 2 ;; + stop) [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" do_stop [ "$VERBOSE" != no ] && log_end_msg_wrapper $? 2 ;; + restart|force-reload) log_daemon_msg "Restarting $DESC" "$NAME" do_stop @@ -210,7 +216,7 @@ case "$1" in esac ;; *) - echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2 + echo "Usage: $SCRIPTNAME {start|force-start|stop|restart|force-reload|status}" >&2 exit 3 ;; esac |