How to Fix ‘Failed to Start Rotate Log Files’ on Ubuntu

The logrotate utility on Ubuntu automates the compression, archiving, and deletion of system log files stored in /var/log/, preventing storage solid-state drives from filling to capacity. Managed via a systemd timer (logrotate.timer), logrotate runs daily maintenance tasks. When systemd logs “Failed to start logrotate.service: Rotate log files”, log files accumulate unchecked. Resolving this issue involves verifying configuration syntax and repairing state file permissions.

Check Service Status and Systemd Journal Output

Determine the exact exit code or configuration failure preventing logrotate from completing its rotation pass.

  1. Open a terminal (Ctrl + Alt + T).
  2. Query the systemd service status:
    systemctl status logrotate.service
  3. Inspect detailed journal logs for parser errors:
    sudo journalctl -u logrotate -b --no-pager
  4. Note which specific configuration file in /etc/logrotate.d/ is flagged as erroneous.

Execute a Manual Dry-Run in Verbose Debug Mode

Running logrotate manually in test mode isolates permission violations or invalid directives without altering live log files.

  • Execute a verbose dry-run:
    sudo logrotate -d /etc/logrotate.conf
  • The utility will simulate rotating every configured log file and print line-by-line debug output.
  • If an orphaned application configuration file (e.g. from an uninstalled package) references a non-existent log directory without the missingok directive, remove or edit the file.

Repair Permissions on /var/lib/logrotate/status

Logrotate records timestamp markers in its status ledger file. If permissions become corrupted, the service aborts.

  1. Inspect ownership on the status file:
    ls -la /var/lib/logrotate/status
  2. Ensure ownership is assigned to root:root with 644 permissions:
    sudo chown root:root /var/lib/logrotate/status
    sudo chmod 644 /var/lib/logrotate/status
  3. If the status file is corrupted or unreadable, remove it so logrotate can regenerate a clean ledger:
    sudo rm -f /var/lib/logrotate/status
    sudo logrotate -v /etc/logrotate.conf

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.