Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* 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.
  • Loading branch information...
commit 2553e2717a86e73a4f1065ba1aa4af546463b798 1 parent 8d9aca4
@yarikoptic yarikoptic authored
Showing with 17 additions and 7 deletions.
  1. +1 −0  .gitignore
  2. +5 −2 debian/changelog
  3. +11 −5 debian/fail2ban.init
View
1  .gitignore
@@ -0,0 +1 @@
+*~
View
7 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
View
16 debian/fail2ban.init 100644 → 100755
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.