[cee/sd][Cephadm] error: skipping "/var/log/ceph/cephadm.log" because parent directory has insecure permissions. Set "su" directive in config file to tell logrotate which user/group should be uer/group should be used for rotation.
.Log rotation of the `cephadm.log` should no longer cause issues
Previously, the `logrotate` command would cause issues if `/var/log/ceph` directory was created by something other than `cephadm`, for example `ceph-common` or `ceph-ansible`. As a consequence, the `cephadm.log` could not be rotated.
With this fix, `su root root` was added to the logrotate configuration to rotate as a `root` user. The `logrotate` command no longer causes an issue with the ownership of `var/log/ceph` directory, therefore the `cephadm.log` is rotated as expected.
Description of problem:
/etc/cron.daily/logrotate:
error: skipping "/var/log/ceph/cephadm.log" 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.
Version-Release number of selected component (if applicable):
ceph version 16.2.0-152.el8cp
How reproducible:
Always
Steps to Reproduce:
1. see the /etc/logrotate.d/cephadm
2. try to rotate the logs using command"logrotate /etc/logrotate.d/cephadm"
3. my /etc/logrotate.d/cephadm
# cat /etc/logrotate.d/cephadm
==================================
# created by cephadm
/var/log/ceph/cephadm.log {
rotate 7
daily
compress
missingok
notifempty
}
==================================
Actual results:
error: skipping "/var/log/ceph/cephadm.log" 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.
Expected results:
logs should be rotated
Additional info:
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Red Hat Ceph Storage 6.0 Bug Fix update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2023:1360
Description of problem: /etc/cron.daily/logrotate: error: skipping "/var/log/ceph/cephadm.log" 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. Version-Release number of selected component (if applicable): ceph version 16.2.0-152.el8cp How reproducible: Always Steps to Reproduce: 1. see the /etc/logrotate.d/cephadm 2. try to rotate the logs using command"logrotate /etc/logrotate.d/cephadm" 3. my /etc/logrotate.d/cephadm # cat /etc/logrotate.d/cephadm ================================== # created by cephadm /var/log/ceph/cephadm.log { rotate 7 daily compress missingok notifempty } ================================== Actual results: error: skipping "/var/log/ceph/cephadm.log" 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. Expected results: logs should be rotated Additional info: