mirror of https://github.com/fail2ban/fail2ban
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.pull/2182/head
parent
e0097aefb9
commit
c8ed0e0d91
|
@ -26,6 +26,7 @@ extra_started_commands="reload showlog"
|
||||||
command="/usr/bin/fail2ban-client"
|
command="/usr/bin/fail2ban-client"
|
||||||
command_args="${FAIL2BAN_OPTIONS}"
|
command_args="${FAIL2BAN_OPTIONS}"
|
||||||
pidfile="/run/${RC_SVCNAME}/${RC_SVCNAME}.pid"
|
pidfile="/run/${RC_SVCNAME}/${RC_SVCNAME}.pid"
|
||||||
|
retry="30"
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
use logger
|
use logger
|
||||||
|
@ -49,7 +50,7 @@ start() {
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
ebegin "Stopping ${RC_SVCNAME}"
|
ebegin "Stopping ${RC_SVCNAME}"
|
||||||
start-stop-daemon --stop --pidfile "${pidfile}" --retry 30 \
|
start-stop-daemon --stop --pidfile "${pidfile}" --retry "${retry}" \
|
||||||
-- ${command} ${command_args} stop
|
-- ${command} ${command_args} stop
|
||||||
eend $? "Failed to stop ${RC_SVCNAME}"
|
eend $? "Failed to stop ${RC_SVCNAME}"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue