BF: gentoo-initd assure /var/run dir + remove stale sock file

Gentoo  Bug #347477
Picked up from

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-analyzer/fail2ban/files/gentoo-initd_create_run_dir.patch?view=markup
pull/8/head
Michael Lorant 2011-11-18 14:51:03 -05:00 committed by Yaroslav Halchenko
parent eda7efbca3
commit c48c2b19a0
1 changed files with 8 additions and 0 deletions

View File

@ -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"
}