files/fail2ban-openrc.init: use the standard OpenRC "retry" variable.

If the "retry" variable is set in the service script, we don't have to
pass it to start-stop-daemon explicitly. While we can't immediately
eliminate any code with this change, it will be necessary later to
adopt the default OpenRC stop() function.
This commit is contained in:
Michael Orlitzky 2018-07-15 13:44:53 -04:00
parent e0097aefb9
commit c8ed0e0d91

View file

@ -26,6 +26,7 @@ extra_started_commands="reload showlog"
command="/usr/bin/fail2ban-client"
command_args="${FAIL2BAN_OPTIONS}"
pidfile="/run/${RC_SVCNAME}/${RC_SVCNAME}.pid"
retry="30"
depend() {
use logger
@ -49,7 +50,7 @@ start() {
stop() {
ebegin "Stopping ${RC_SVCNAME}"
start-stop-daemon --stop --pidfile "${pidfile}" --retry 30 \
start-stop-daemon --stop --pidfile "${pidfile}" --retry "${retry}" \
-- ${command} ${command_args} stop
eend $? "Failed to stop ${RC_SVCNAME}"
}