From 9b566fe458fb36eb5eb3212b01bc6ba48ac8349a Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud Date: Tue, 11 Mar 2025 15:55:11 +0100 Subject: [PATCH] Leapp upgrade: skip systemctl calls During LEAPP upgrade, the system is booted in a special mode without systemd. As a consequence, any scriptlet calling systemctl fails and may break the upgrade. Skip the call to systemctl if a LEAPP upgrade is in progress (this is easily checked using the env variable $LEAPP_IPU_IN_PROGRESS that is set for instance to LEAPP_IPU_IN_PROGRESS=8to9). Fixes: RHEL-82089 Signed-off-by: Florence Blanc-Renaud Reviewed-By: Rob Crittenden --- freeipa.spec.in | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/freeipa.spec.in b/freeipa.spec.in index b539f51f88a19a3686684dd0a9138add97bbd285..143ee5c83d16b59531feda011c087c0ab4c82786 100755 --- a/freeipa.spec.in +++ b/freeipa.spec.in @@ -1241,8 +1241,11 @@ if [ $1 = 0 ]; then # NOTE: systemd specific section /bin/systemctl --quiet stop ipa.service || : /bin/systemctl --quiet disable ipa.service || : - /bin/systemctl reload-or-try-restart dbus - /bin/systemctl reload-or-try-restart oddjobd + # Skip systemctl calls when leapp upgrade is in progress + if [ -z "$LEAPP_IPU_IN_PROGRESS" ] ; then + /bin/systemctl reload-or-try-restart dbus + /bin/systemctl reload-or-try-restart oddjobd + fi # END fi @@ -1306,8 +1309,11 @@ fi %preun server-trust-ad if [ $1 -eq 0 ]; then %{_sbindir}/update-alternatives --remove winbind_krb5_locator.so /dev/null - /bin/systemctl reload-or-try-restart dbus - /bin/systemctl reload-or-try-restart oddjobd + # Skip systemctl calls when leapp upgrade is in progress + if [ -z "$LEAPP_IPU_IN_PROGRESS" ] ; then + /bin/systemctl reload-or-try-restart dbus + /bin/systemctl reload-or-try-restart oddjobd + fi fi # ONLY_CLIENT -- 2.48.1