Articles in this section

Various actions fail in Plesk with Fail2Ban installed after server reboot: Unable to open file /run/lock/files/, There is no directory /var/run/

kb: bug Plesk Onyx for Linux ABT: Group B

Applicable to:

  • Plesk Onyx for Linux

Symptoms

  • Cannot start Fail2ban at Tools & Settings > Service Management:

    PLESK_ERROR: Unable to start service: Unable to manage service by f2bmng: ('start', 'fail2ban'). Error: Job for fail2ban.service failed because the control process exited with error code. See "systemctl status fail2ban.service" and "journalctl -xe" for details. ERROR:__main__:Failed to start fail2ban service

  • Journalctl shows the following errors:

    # journalctl -u fail2ban.service
    server fail2ban-client[320]: ERROR There is no directory /var/run/fail2ban to contain the socket file /var/run/fail2ban/fail2ban.sock.

  • Cannot enable mail forwarding for a mail account or create a domain:

    PLESK_ERROR: Error: mailmng-mailname failed: Unable to open file "/run/lock/files/c1be0a084f503a66d2be105959ad7f82": No such file or directory.
    System error 2: No such file or directory
    Error occurred while locking the file /var/qmail/mailnames/example.com/johndoe/.qmail: No such file or directory

  • Backup creation fails:

    PLESK_ERROR: Error: server "server" Cannot encrypt dump file (this is not fatal error!): PHP Warning: fopen(/run/lock/files/backup_encrypt.lock): failed to open stream: No such file or directory; File: /opt/psa/admin/plib/backup/Encryptor.php, Line: 499 ERR [panel] Unable to open file /run/lock/files/backup_encrypt.lock

  • Cannot log in to mail account:

    PLESK_ERROR: Error: mailmng-domain failed: Unable to open file "/run/lock/files/fe62a04da3d34705ecf91a44f538edf6": No such file or directory.
    System error 2: No such file or directory
    Error occurred while locking the file /var/qmail/control/rejectnonexist: No such file or directory

  • 'plesk repair dns' fails:

    CONFIG_TEXT: PHP Fatal error: Uncaught PleskMultipleException: Error during updateZone: dnsmng failed: dnsmng: Unable to open file "/run/lock/files/...

  • /run/lock/files/ or /run/fail2ban/ directory is absent:

    # ls -ld /run/lock/files /run/fail2ban
    ls: cannot access /run/lock/files: No such file or directory
    ls: cannot access /run/fail2ban: No such file or directory

Cause

The dynamic directory /run is re-created every server reboot but not all the required sub-folders are re-created.

Plesk bug with ID #PPPM-10011 which is planned to be fixed in one of the future product updates.

Resolution

As a workaround, configure the system to re-create the missing directories after each server reboot:

  1. Connect to the server via SSH;

  2. Create the missing directories:

    # mkdir /run/lock/files
    # mkdir /run/fail2ban

  3. Set correct permissions:

    # chown root:psaadm /run/lock/files/
    # chmod 770 /run/lock/files/

    # chown root:root /run/fail2ban
    # chmod 755 /run/fail2ban

  4. Create the files:

    Note: This step is for OS with Systemd support, for example, CentOS 7, Ubuntu 16 and etc.

    Note: This step requires root:root owner and group for "/" partition to work. Check with command "# ls -ld /"

    # echo "d /run/lock/files/ 0770 root psaadm" > /etc/tmpfiles.d/lockfiles.conf
    # echo "d /run/fail2ban 0755 root root" > /etc/tmpfiles.d/fail2ban.conf

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.