]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: stop sidecar systemd units when restarting main units 62525/head
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 26 Mar 2025 17:37:04 +0000 (13:37 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Wed, 26 Mar 2025 18:19:46 +0000 (14:19 -0400)
Previously, sidecar units might (will) not be stopped when the primary
unit is stopped. This breaks the normal cephadm workflow to redeploy:
stop and then start the services. This patch reuses the logic from
the service stop to stop the individual sidecars.

Note: the sidecars are not individually started as that should already
be handled automatically when starting the primary service!

Co-authored-by: Adam King <adking@redhat.com>
Signed-off-by: Adam King <adking@redhat.com>
Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/cephadm.py

index 770537d6f06ab4666fec9a18b53c7350fc86b3bb..ce639d3bf6ff26708f6578cc723ffc19c305f543 100755 (executable)
@@ -1198,6 +1198,17 @@ def deploy_daemon_units(
          verbosity=CallVerbosity.DEBUG)
     call(ctx, ['systemctl', 'reset-failed', unit_name],
          verbosity=CallVerbosity.DEBUG)
+
+    # TODO: this should happen automatically some day
+    sd_path_info = systemd_unit.sidecars_from_dropin(
+        systemd_unit.PathInfo(ctx.unit_dir, ident), missing_ok=True
+    )
+    for sc_unit in sd_path_info.sidecar_unit_files.values():
+        call(ctx, ['systemctl', 'stop', sc_unit.name],
+             verbosity=CallVerbosity.DEBUG)
+        call(ctx, ['systemctl', 'reset-failed', sc_unit.name],
+             verbosity=CallVerbosity.DEBUG)
+
     if enable:
         call_throws(ctx, ['systemctl', 'enable', unit_name])
     if start: