Articles in this section

Access logs are not rotated on Plesk server: Rotation of files with multiple hard links is not allowed

kb: bug kb: fixed Plesk Obsidian for Linux

Applicable to:

  • Plesk Obsidian for Linux

Symptoms

  • Log rotation doesn't rotate logs, resulting in no compressed .gz files being created.

  • Forcing log rotation for specific domain results in error

    # /usr/local/psa/logrotate/sbin/logrotate -v -f /usr/local/psa/etc/logrotate.d/example.com
    (...)
    considering log /var/www/vhosts/system/example.com/logs/access_log.processed log /var/www/vhosts/system/example.com/logs/access_log.processed has multiple (2) hard links. Rotation of files with multiple hard links is not allowed for /var/www/vhosts/system/example.com/logs/*.processed -- skipping.
    (...)

Cause

Product issues:

  • #PPPM-13562 "Fixed the issue where log rotation failed for files with two or more hard links."
    Fixed in:
  • #PPPM-13473 "Log rotation now works correctly after updating to Plesk Obsidian 18.0.42."
    Fixed in:
  • #PPPM-13519 "Log rotation now works correctly after updating to Plesk Obsidian 18.0.43 even if /usr/local/psa/etc/logrotate.conf was customized."
    Fixed in:

Resolution

Please consider updating your server:

Workaround

If update is not possible for some reason you may try the following

workaround

Please consider updating your server:


Or:

If update is not possible for some reason, you may try the following
It is possible to use the sed command to add allowhardlink option to all logrotate config files.

  1. Connect to the Plesk server via SSH.

  2. Use the following command to apply the option to all logrotate configuration files:

    # sed -i '/copytruncate/a allowhardlink' /usr/local/psa/etc/logrotate.d/*

  3. Force rotation:

    To rotate logs for a single domain:

    # /usr/local/psa/admin/sbin/statistics --calculate-one --domain-name=example.com

    To rotate logs for all domains:

    # /usr/local/psa/bin/sw-engine-pleskrun /usr/local/psa/admin/plib/DailyMaintainance/script.php -f ExecuteStatistics

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.