Project

General

Profile

Bug #57917

cephadm: duplicate log entry for /var/log/ceph/cephadm.log

Added by Michael Fritch 3 months ago. Updated 3 months ago.

Status:
New
Priority:
Normal
Category:
cephadm (binary)
Target version:
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Configuration of logrotate for /var/lib/ceph/cephadm.log was added (and backported to Pacific) via this PR:
https://github.com/ceph/ceph/pull/41283

However, a global config of for /var/lib/ceph/*.log is already present in the ceph-base RPM.

Using cephadm while also having the ceph-base RPM installed causes logrotate to fail with a duplicate log entry message

node1:~ # logrotate --force /etc/logrotate.d/*
error: /etc/logrotate.d/cephadm:2 duplicate log entry for /var/log/ceph/cephadm.log

node1:~ # cat /etc/logrotate.d/ceph | head -1
/var/log/ceph/*.log {

node1:~ # rpm -qf /etc/logrotate.d/ceph
ceph-base-16.2.9.536+g41a9f9a5573-150300.3.3.1.x86_64

node1:~ # cat /etc/logrotate.d/cephadm | head -2
# created by cephadm
/var/log/ceph/cephadm.log {

History

#1 Updated by Michael Fritch 3 months ago

this is also problematic for users upgrading from Octopus based clusters to Pacific.

#2 Updated by Michael Fritch 3 months ago

  • Description updated (diff)

#3 Updated by Michael Fritch 3 months ago

  • Description updated (diff)

#4 Updated by Michael Fritch 3 months ago

As a workaround, I tried a `prerotate` script:

node3:~ # cat /etc/logrotate.d/ceph
/var/log/ceph/*.log {
    rotate 7
    daily
    compress
    nosharedscripts
    prerotate
        bash -c "[[ ! $1 =~ cephadm ]]" 
    endscript
    postrotate
        killall -q -1 ceph-mon ceph-mgr ceph-mds ceph-osd ceph-fuse radosgw rbd-mirror cephfs-mirror || pkill -1 -x "ceph-mon|ceph-mgr|ceph-mds|ceph-osd|ceph-fuse|radosgw|rbd-mirror|cephfs-mirror" || true
    endscript
    missingok
    notifempty
    su root ceph
}

But, logrotate will fail with an additional error:

node3:~ # logrotate --force /etc/logrotate.d/
error: cephadm:2 duplicate log entry for /var/log/ceph/cephadm.log
error: found error in file cephadm, skipping
error: error running non-shared prerotate script for /var/log/ceph/cephadm.log of '/var/log/ceph/*.log '

Also available in: Atom PDF