On 07/11/2013 11:38 AM, Alexander Bokovoy wrote:
> On Thu, 11 Jul 2013, Alexander Bokovoy wrote:
>> On Wed, 10 Jul 2013, Ana Krivokapic wrote:
>>> On 07/08/2013 08:32 AM, Alexander Bokovoy wrote:
>>>> On Thu, 20 Jun 2013, Ana Krivokapic wrote:
>>>>> Hello,
>>>>>
>>>>> Attached patches fix systemd and ipactl related bugs:
>>>>>
>>>>> https://fedorahosted.org/freeipa/ticket/3730
>>>>> https://fedorahosted.org/freeipa/ticket/3729
>>>> NACK. For me upgrade case fails (rpm -Uhv), dirsrv didn't restart on
>>>> upgrade properly and everything else has failed afterwards.
>>>>
>>>
>>> This was caused due to 'systemctl is-active' returning exit status 3
>>> ('activating'), and our code treating the non-zero exit status as a 
>>> failure. I
>>> handled this case in the updated patch.
>>>
>>> As for the ipa.service and dependency ordering, I have done some further
>>> testing
>>> and found out the adding the '--ignore-dependencies' switch alone solves the
>>> shutdown issue. So I think that no modification of ipa.service file is
>>> necessary.
>>>
>>> Updated patches are attached.
>> This is much better. However, 'ipactl stop' doesn't stop ns-slapd and
>> dogtag:
> What's important is the fact that now I can issue reboot and VM
> restarts, not hangs, and then IPA starts properly on boot -- this is
> because when ns-slapd gets a signal from systemd, it automatically shuts
> itself down properly and the same happens to dogtag. This is good
> enough so that I push current patches to master but please proceed on
> fixing 'ipactl stop' issue.
>
>

Thanks for catching that. I am attaching a patch which should solve this issue.


-- 
Regards,

Ana Krivokapic
Associate Software Engineer
FreeIPA team
Red Hat Inc.

From b79e839154d09fd1fadd35eb689fb9daba8ec88b Mon Sep 17 00:00:00 2001
From: Ana Krivokapic <akriv...@redhat.com>
Date: Thu, 11 Jul 2013 14:23:05 +0200
Subject: [PATCH] Use --ignore-dependencies only when necessary

Using the --ignore-dependencies switch was causing the ipactl stop command
not to stop all instances of dirsrv and dogtag. Make sure the switch is used
only when necessary, i.e. to prevent ipa-otpd.socket from getting stuck during
the shutdown transaction.

https://fedorahosted.org/freeipa/ticket/3730
https://fedorahosted.org/freeipa/ticket/3729
---
 ipapython/platform/base/systemd.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/ipapython/platform/base/systemd.py b/ipapython/platform/base/systemd.py
index 84287e388f5ddeaf503f1a20579183716a75e677..f1220186840ffe62d9b0ded985532e7d0f8931ee 100644
--- a/ipapython/platform/base/systemd.py
+++ b/ipapython/platform/base/systemd.py
@@ -98,15 +98,16 @@ def __wait_for_open_ports(self, instance_name=""):
 
     def stop(self, instance_name="", capture_output=True):
         instance = self.service_instance(instance_name)
+        args = ["/bin/systemctl", "stop", instance]
 
         # The --ignore-dependencies switch is used to avoid possible
         # deadlock during the shutdown transaction. For more details, see
         # https://fedorahosted.org/freeipa/ticket/3729#comment:1 and
         # https://bugzilla.redhat.com/show_bug.cgi?id=973331#c11
-        ipautil.run(
-            ["/bin/systemctl", "stop", instance, "--ignore-dependencies"],
-            capture_output=capture_output
-        )
+        if instance == "ipa-otpd.socket":
+            args.append("--ignore-dependencies")
+
+        ipautil.run(args, capture_output=capture_output)
 
         if 'context' in api.env and api.env.context in ['ipactl', 'installer']:
             update_service_list = True
-- 
1.8.1.4

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to