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 <flo@redhat.com>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Florence Blanc-Renaud
2024-07-02 10:25:08 +02:00
parent 2f902efd0e
commit 6fe268af5b

View File

@@ -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"