Make sure log files exist before resuming jails after logrotate

tags/0.1.17_el6 0.1.17_el6
Daniel Berteaud 8 years ago
parent 3738f0a5bf
commit bc93ec4649
  1. 4
      root/etc/e-smith/events/actions/fail2ban-resume-logs

@ -6,6 +6,8 @@ if [ "$STATUS" != "enabled" ]; then
fi
sleep 1
# Makes sure /var/log/httpd/error_log is not a dangling symlink
[ -e /var/log/httpd/error_log ] || touch /var/log/httpd/error_log
for JAIL in http-overflows http-noscript http-scan http-auth; do
/usr/bin/fail2ban-client status $JAIL > /dev/null 2>&1
if [ $? -eq 0 ]; then
@ -13,6 +15,7 @@ for JAIL in http-overflows http-noscript http-scan http-auth; do
fi
done
[ -e /var/log/secure ] || touch /var/log/secure
for JAIL in pam-generic ftp; do
/usr/bin/fail2ban-client status $JAIL > /dev/null 2>&1
if [ $? -eq 0 ]; then
@ -20,6 +23,7 @@ for JAIL in pam-generic ftp; do
fi
done
[ -e /var/log/messages ] || touch /var/log/messages
for JAIL in lemonldap; do
/usr/bin/fail2ban-client status $JAIL > /dev/null 2>&1
if [ $? -eq 0 ]; then

Loading…
Cancel
Save