Bug 2099670

Summary: [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.
Product: [Red Hat Storage] Red Hat Ceph Storage Reporter: Milind <milverma>
Component: CephadmAssignee: Adam King <adking>
Status: CLOSED ERRATA QA Contact: Rajendra Khambadkar <rkhambad>
Severity: low Docs Contact: Eliska <ekristov>
Priority: unspecified    
Version: 5.0CC: adking, cephqe-warriors, ekristov, gjose, lithomas, mcaldeir, mgowri, nravinas, redhat-bugzilla, rkhambad, robert.scheck, tserlin, vdas, vereddy
Target Milestone: ---   
Target Release: 6.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: ceph-17.2.3-12.el9cp Doc Type: Bug Fix
Doc Text:
.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.
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-03-20 18:56:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2126050    

Description Milind 2022-06-21 13:10:08 UTC
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:

Comment 20 Adam King 2022-09-27 12:43:56 UTC
*** Bug 2099669 has been marked as a duplicate of this bug. ***

Comment 29 errata-xmlrpc 2023-03-20 18:56:39 UTC
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