diff --git a/files/gentoo-initd b/files/gentoo-initd index cd13b2d1..af4d8c34 100755 --- a/files/gentoo-initd +++ b/files/gentoo-initd @@ -31,6 +31,14 @@ depend() { start() { ebegin "Starting fail2ban" + if [ ! -d /var/run/fail2ban ]; then + mkdir /var/run/fail2ban || return 1 + fi + if [ -e /var/run/fail2ban/fail2ban.sock ]; then + # remove stalled sock file after system crash + # bug 347477 + rm -rf /var/run/fail2ban/fail2ban.sock || return 1 + fi ${FAIL2BAN} start &> /dev/null eend $? "Failed to start fail2ban" }