Project

General

Profile

Actions

Bug #57917

open

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

Added by Michael Fritch over 1 year ago. Updated about 1 year 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 {
Actions #1

Updated by Michael Fritch over 1 year ago

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

Actions #2

Updated by Michael Fritch over 1 year ago

  • Description updated (diff)
Actions #3

Updated by Michael Fritch over 1 year ago

  • Description updated (diff)
Actions #4

Updated by Michael Fritch over 1 year 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 '

Actions #5

Updated by Ilya Dryomov about 1 year ago

  • Target version deleted (v16.2.11)
Actions

Also available in: Atom PDF