Results 1 to 3 of 3

Thread: cron logrotate error

  1. #1
    Join Date
    Jul 2014
    Beans
    340

    Question cron logrotate error

    Hi all,
    Getting below error:
    Code:
    /etc/cron.daily/logrotate:
     Failed to access socket path: /var/run/fail2ban/fail2ban.sock. Is fail2ban running?
    error: error running non-shared postrotate script for /var/log/fail2ban.log of '/var/log/fail2ban.log '
    run-parts: /etc/cron.daily/logrotate exited with return code 1
    How do I fix it? Please advise.

  2. #2
    Join Date
    Jun 2006
    Location
    Nux Jam
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: cron logrotate error

    fail2ban.sock might be one of these non-shared postrotate script

  3. #3
    Join Date
    Jul 2009
    Beans
    516
    Distro
    Ubuntu 16.04 Xenial Xerus

    Re: cron logrotate error

    Quote Originally Posted by dino99 View Post
    fail2ban.sock might be one of these non-shared postrotate script
    Nope, it's a unix socket used to control the fail2ban process. That message will mean that either the logrotate script doesn't have permission to access it, unlikely, or the fail2ban process isn't running so the socket doesn't exist.

    You don't mention which version of Ubuntu you're using so it may have changed, but on mine the postrotate hook looks like
    Code:
        postrotate
             fail2ban-client flushlogs 1>/dev/null
        endscript
    Are you running fail2ban? If not, just uninstall it.

    If you want to leave it on there you could always just redirect stderr as in
    Code:
    fail2ban-client flushlogs 2>&1 1>/dev/null
    which will suppress that message.

    If you need anymore info then please provide the contents of your /etc/logrotate.d/fail2ban file.
    Mark your thread as [SOLVED], use Thread Tools on forum page.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •