summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--debian/changelog7
-rwxr-xr-x[-rw-r--r--]debian/fail2ban.init16
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