mirror of https://github.com/fail2ban/fail2ban
files/fail2ban-openrc.init: replace FAIL2BAN with standard OpenRC variables.
The FAIL2BAN variable in our OpenRC service script was a combination of two standard OpenRC variables, "command" and "command_args". This commit simply replaces the custom variable with the two standard ones. This will aid future simplifications of the service script.pull/2182/head
parent
af24c52558
commit
bc4a742e32
|
@ -23,7 +23,8 @@ description_reload="reload configuration"
|
||||||
description_showlog="show fail2ban logs"
|
description_showlog="show fail2ban logs"
|
||||||
extra_started_commands="reload showlog"
|
extra_started_commands="reload showlog"
|
||||||
|
|
||||||
FAIL2BAN="/usr/bin/fail2ban-client ${FAIL2BAN_OPTIONS}"
|
command="/usr/bin/fail2ban-client"
|
||||||
|
command_args="${FAIL2BAN_OPTIONS}"
|
||||||
|
|
||||||
depend() {
|
depend() {
|
||||||
use logger
|
use logger
|
||||||
|
@ -37,20 +38,20 @@ start() {
|
||||||
# bug 347477
|
# bug 347477
|
||||||
rm -f /var/run/fail2ban/fail2ban.sock || return 1
|
rm -f /var/run/fail2ban/fail2ban.sock || return 1
|
||||||
start-stop-daemon --start --pidfile /var/run/fail2ban/fail2ban.pid \
|
start-stop-daemon --start --pidfile /var/run/fail2ban/fail2ban.pid \
|
||||||
-- ${FAIL2BAN} start
|
-- ${command} ${command_args} start
|
||||||
eend $? "Failed to start fail2ban"
|
eend $? "Failed to start fail2ban"
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
ebegin "Stopping fail2ban"
|
ebegin "Stopping fail2ban"
|
||||||
start-stop-daemon --stop --pidfile /var/run/fail2ban/fail2ban.pid --retry 30 \
|
start-stop-daemon --stop --pidfile /var/run/fail2ban/fail2ban.pid --retry 30 \
|
||||||
-- ${FAIL2BAN} stop
|
-- ${command} ${command_args} stop
|
||||||
eend $? "Failed to stop fail2ban"
|
eend $? "Failed to stop fail2ban"
|
||||||
}
|
}
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
ebegin "Reloading fail2ban"
|
ebegin "Reloading fail2ban"
|
||||||
${FAIL2BAN} reload
|
${command} ${command_args} reload
|
||||||
eend $? "Failed to reload fail2ban"
|
eend $? "Failed to reload fail2ban"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue