Public bug reported:
rsyslog on Ubuntu 24.04 does not rotate its logs: logrotate skips the
whole /etc/logrotate.d/rsyslog stanza.
Package: rsyslog
Release: Ubuntu 24.04 LTS (noble)
Affected version: 8.2312.0-3ubuntu9.4 (noble-updates / noble-security)
logrotate: 3.21.0-2build1
SUMMARY
-------
/etc/logrotate.d/rsyslog does not contain a "su" directive. On Ubuntu Noble
/var/log is 775 root:syslog, while /etc/logrotate.conf has a global "su root
adm". logrotate 3.21 refuses to rotate files in a group-writable directory
unless the su group matches, so every rsyslog log is skipped:
error: skipping "/var/log/syslog" because parent directory has insecure
permissions (It's world writable or writable by group which is not
"root") Set "su" directive in config file to tell logrotate which
user/group should be used for rotation.
logrotate.service still exits with status 0, so the failure is silent
and /var/log/syslog grows without rotation until the disk fills.
STEPS TO REPRODUCE
------------------
1. Install Ubuntu 24.04.
2. Ensure rsyslog 8.2312.0-3ubuntu9.4 and logrotate 3.21.0-2build1.
3. Run:
logrotate -d /etc/logrotate.d/rsyslog
4. Observe the "error: skipping ... insecure permissions" lines.
5. Wait for logrotate.timer (or run logrotate -f /etc/logrotate.d/rsyslog): the
listed files are not rotated.
EXPECTED BEHAVIOR
-----------------
logrotate rotates the listed files according to the shipped policy.
ACTUAL BEHAVIOR
---------------
Every file in the stanza is skipped, and no error is propagated to systemd.
EVIDENCE
--------
- /var/log is 775 root:syslog.
- /etc/logrotate.conf contains "su root adm".
- /etc/logrotate.d/rsyslog has no su line, and the conffile matches the package
(dpkg -V rsyslog is clean).
- logrotate 3.21.0-2build1, rsyslog 8.2312.0-3ubuntu9.4.
- Adding "su root syslog" makes logrotate -d pass and a forced rotation
actually rotates the files; rsyslog stays active.
PROPOSED FIX
------------
Add the directive to the rsyslog logrotate stanza:
{
su root syslog
...
}
Upstream packaging PR:
https://github.com/rsyslog/rsyslog/pull/8037
Repro and host-level fixer:
https://github.com/devcustrom/server-ops-fixes
NOTES
-----
The same file in the upstream PPA packaging tree has the same omission.
The fix is Ubuntu-specific: on Debian /var/log is not group-writable, so su is
not required there.
** Affects: rsyslog (Ubuntu)
Importance: Undecided
Status: New
** Tags: logrotate noble
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2175140
Title:
rsyslog logrotate config lacks "su root syslog" - rotation silently
skipped on Noble
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rsyslog/+bug/2175140/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs