Affected versions: Ubuntu 24.04 LTS Ubuntu 24.04 Ubuntu 24.04.1

📖 ~1 min read

Table of contents
  1. Symptom & Impact
  2. Environment & Reproduction
  3. Root Cause Analysis
  4. Quick Triage
  5. Step-by-Step Diagnosis
  6. Solution – Primary Fix
  7. Solution – Alternative Approaches
  8. Verification & Acceptance Criteria
  9. Rollback Plan
  10. Prevention & Hardening
  11. Related Errors & Cross-Refs
  12. References & Further Reading

Symptom & Impact

Logs do not rotate as expected, increasing disk pressure and retention risk.

Environment & Reproduction

Appears when custom app logs have incorrect owner/group or mode settings.

sudo logrotate -d /etc/logrotate.conf

Root Cause Analysis

logrotate cannot read or rotate target logs due to ACL, owner, or path issues.

Quick Triage

Check failing file paths and permissions reported in dry-run output.

sudo logrotate -d /etc/logrotate.conf | tail -n 80

Step-by-Step Diagnosis

Inspect ownership and app write behavior for failing log files.

ls -l /var/log
namei -l /var/log/.log
Illustrative mockup for ubuntu-24-04-lts — terminal_or_console
Diagnosis commands for post 169 — Illustrative mockup — Progressive Robot

Solution – Primary Fix

Correct ownership, ensure create directives match runtime user, and rerun rotate.

Still having issues? Our IT Solutions & Services team can diagnose and resolve this for you. Get in touch for a free consultation.

sudo chown : /var/log/.log
sudo logrotate -f /etc/logrotate.conf
Illustrative mockup for ubuntu-24-04-lts — log_or_dashboard
Fix validation evidence for post 169 — Illustrative mockup — Progressive Robot

Solution – Alternative Approaches

Use copytruncate for processes that cannot reopen log descriptors.

sudo grep -R 'copytruncate' /etc/logrotate.d 2>/dev/null

Verification & Acceptance Criteria

Rotation creates new files with expected mode and no errors.

sudo logrotate -f /etc/logrotate.conf
ls -l /var/log | head

Rollback Plan

Restore previous logrotate snippet if application logging regresses.

sudo cp /etc/logrotate.d/.bak /etc/logrotate.d/

Prevention & Hardening

Standardize app log ownership and validate snippets before deploy.

sudo logrotate -d /etc/logrotate.conf

Related to skipping because parent directory has insecure permissions and permission denied.

Related tutorial: View the step-by-step tutorial for Ubuntu 24.04 LTS.

View all Ubuntu 24.04 LTS tutorials on the Tutorials Hub →

Browse all common problems & solutions on the Tutorials Hub.

References & Further Reading

Ubuntu logrotate and system logging documentation.

Need Expert Help?

If you cannot resolve this yourself, our team offers hands-on Server Management, Managed IT Services, and flexible Support Plans. Contact us today — we respond within one business day.