#!/sbin/openrc-run # Copyright 1999-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 description="Scan logs and take action (fail2ban alternative)" : ${REACTION_CONFIG:=/etc/reaction/} command="/usr/bin/reaction" command_args="start -c ${REACTION_CONFIG} ${REACTION_OPTS}" supervisor="supervise-daemon" directory="/var/lib/reaction" output_log="/var/log/${RC_SVCNAME}.log" error_log="/var/log/${RC_SVCNAME}.log" depend() { need net use logger after iptables ip6tables nftables shorewall shorewall6 } start_pre() { # reaction keeps its database in ${directory} and creates its # control socket in /run/reaction checkpath --directory --mode 0700 "${directory}" checkpath --directory --mode 0755 /run/reaction checkpath --file --mode 0640 "${output_log}" }