From 6fe268af5bc6c5296f7a380917e3134f8fa46fda Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud Date: Jul 08 2024 13:26:24 +0000 Subject: Uninstall: stop sssd-kcm before removing KCM ccaches database The service is socket-activated and will be restarted whenever needed. It must be stopped before the database is removed otherwise it fails to recreate the file. Fixes: https://pagure.io/freeipa/issue/9616 Signed-off-by: Florence Blanc-Renaud Reviewed-By: Rob Crittenden --- diff --git a/ipaclient/install/client.py b/ipaclient/install/client.py index 2483b44..802db96 100644 --- a/ipaclient/install/client.py +++ b/ipaclient/install/client.py @@ -3601,6 +3601,12 @@ def uninstall(options): remove_file(paths.SSSD_LDB) remove_file(paths.SSSD_CONFIG_LDB) + # Stop sssd-kcm.service before removing the KCM ccaches database + # it is socket-activated and will be restarted whenever needed + try: + services.service('sssd-kcm', api).stop() + except Exception as e: + logger.warning("Failed to stop sssd-kcm: %s", e) remove_file(paths.SSSD_SECRETS) sssd_timestamps = "timestamps_" + ipa_domain + ".ldb"