From f33dc8a17e7f5093b062022dacc72a1afc1a4d7a Mon Sep 17 00:00:00 2001 From: Adam King Date: Fri, 20 Jan 2023 13:42:00 -0500 Subject: [PATCH] cephadm: don't overwrite cluster logrotate file To allow users to customize the file if they need to akter the settings (e.g. to change the rotation interval or rotate based on size) Fixes: https://tracker.ceph.com/issues/58527 Signed-off-by: Adam King --- src/cephadm/cephadm.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index cb3a7f063d2ef..e7fda5a4ae0b9 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -3887,6 +3887,10 @@ def install_base_units(ctx, fsid): call_throws(ctx, ['systemctl', 'enable', 'ceph-%s.target' % fsid]) call_throws(ctx, ['systemctl', 'start', 'ceph-%s.target' % fsid]) + # don't overwrite file in order to allow users to manipulate it + if os.path.exists(ctx.logrotate_dir + f'/ceph-{fsid}'): + return + # logrotate for the cluster with open(ctx.logrotate_dir + '/ceph-%s' % fsid, 'w') as f: """ -- 2.39.5