]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: don't overwrite cluster logrotate file 49815/head
authorAdam King <adking@redhat.com>
Fri, 20 Jan 2023 18:42:00 +0000 (13:42 -0500)
committerAdam King <adking@redhat.com>
Fri, 20 Jan 2023 18:42:00 +0000 (13:42 -0500)
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 <adking@redhat.com>
src/cephadm/cephadm.py

index cb3a7f063d2ef7c7647aed8031fb684a5479ccd5..e7fda5a4ae0b967076557cdbfed1571db1708fc8 100755 (executable)
@@ -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:
         """