On Tue 06 Nov 2012 02:44:09 AM EST, Jakub Hrozek wrote:

Patch 0003: Fix the SSSDConfig API so that the 'force_timeout'
option is accepted for services and domains (or else consumers of
the API like ipa-client or authconfig might throw 'unknown option'
errors).

======================================================================
FAIL: testListOptions (__main__.SSSDConfigTestSSSDDomain)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "././src/config/SSSDConfigTest.py", line 538, in testListOptions
     option)
AssertionError: Option [force_timeout] unexpectedly found

======================================================================
FAIL: testRemoveProvider (__main__.SSSDConfigTestSSSDDomain)
----------------------------------------------------------------------
Traceback (most recent call last):
   File "././src/config/SSSDConfigTest.py", line 877, in testRemoveProvider
     option)
AssertionError: Option [force_timeout] unexpectedly found

Thanks, I forgot to rerun that. New patches attached
>From dddf553235b05a88b00ee7573c9447f41633fb5f Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgall...@redhat.com>
Date: Mon, 5 Nov 2012 10:56:34 -0500
Subject: [PATCH 3/3] SSSDConfig: Locate the force_timeout option in the
 correct sections

---
 src/config/SSSDConfigTest.py | 2 ++
 src/config/etc/sssd.api.conf | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/config/SSSDConfigTest.py b/src/config/SSSDConfigTest.py
index 5966635d4d3c20d6a1baa80e40c76b14fbcfa8b2..9a05dca3986ad5ad71ea4a2daf6f5923dc0e0726 100755
--- a/src/config/SSSDConfigTest.py
+++ b/src/config/SSSDConfigTest.py
@@ -486,6 +486,7 @@ class SSSDConfigTestSSSDDomain(unittest.TestCase):
             'min_id',
             'max_id',
             'timeout',
+            'force_timeout',
             'try_inotify',
             'command',
             'enumerate',
@@ -825,6 +826,7 @@ class SSSDConfigTestSSSDDomain(unittest.TestCase):
             'min_id',
             'max_id',
             'timeout',
+            'force_timeout',
             'try_inotify',
             'command',
             'enumerate',
diff --git a/src/config/etc/sssd.api.conf b/src/config/etc/sssd.api.conf
index a5af1200bdc033dbdc747ae8adb22f5a703e965a..48fe7ebf0bfa22ced85df612e35b3b14186b80a7 100644
--- a/src/config/etc/sssd.api.conf
+++ b/src/config/etc/sssd.api.conf
@@ -11,13 +11,13 @@ command = str, None, false
 reconnection_retries = int, None, false
 fd_limit = int, None, false
 client_idle_timeout = int, None, false
+force_timeout = int, None, false
 
 [sssd]
 # Monitor service
 services = list, str, true, nss, pam
 domains = list, str, true
 timeout = int, None, false
-force_timeout = int, None, false
 sbus_timeout = int, None, false
 re_expression = str, None, false
 full_name_format = str, None, false
@@ -93,6 +93,7 @@ max_id = int, None, false
 timeout = int, None, false
 try_inotify = bool, None, false
 enumerate = bool, None, false
+force_timeout = int, None, false
 cache_credentials = bool, None, false
 store_legacy_passwords = bool, None, false
 use_fully_qualified_names = bool, None, false
-- 
1.7.12.1

>From 1e53abae3b830d5ad45cd18d965f3b134d7674c4 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgall...@redhat.com>
Date: Mon, 5 Nov 2012 10:55:05 -0500
Subject: [PATCH 2/3] MAN: Specify the correct location for the force_timeout
 option

---
 src/man/sssd.conf.5.xml | 48 ++++++++++++++++++++++++++++++++----------------
 1 file changed, 32 insertions(+), 16 deletions(-)

diff --git a/src/man/sssd.conf.5.xml b/src/man/sssd.conf.5.xml
index f0c3b606eb720312ea5b930e61d3099681657f92..33d99c75892422f94cc96109a1ed7f45fd1b7692 100644
--- a/src/man/sssd.conf.5.xml
+++ b/src/man/sssd.conf.5.xml
@@ -203,22 +203,6 @@
                         </listitem>
                     </varlistentry>
                     <varlistentry>
-                        <term>force_timeout (integer)</term>
-                        <listitem>
-                            <para>
-                                If a service is not responding to ping checks (see
-                                the <quote>timeout</quote> option), it is first sent
-                                the SIGTERM signal that instructs it to quit gracefully.
-                                If the service does not terminate after <quote>force_timeout</quote>
-                                seconds, the monitor will forcibly shut it down by
-                                sending a SIGKILL signal.
-                            </para>
-                            <para>
-                                Default: 60
-                            </para>
-                        </listitem>
-                    </varlistentry>
-                    <varlistentry>
                         <term>default_domain_suffix (string)</term>
                         <listitem>
                             <para>
@@ -347,6 +331,22 @@
                         </para>
                     </listitem>
                 </varlistentry>
+                <varlistentry>
+                    <term>force_timeout (integer)</term>
+                    <listitem>
+                        <para>
+                            If a service is not responding to ping checks (see
+                            the <quote>timeout</quote> option), it is first sent
+                            the SIGTERM signal that instructs it to quit gracefully.
+                            If the service does not terminate after <quote>force_timeout</quote>
+                            seconds, the monitor will forcibly shut it down by
+                            sending a SIGKILL signal.
+                        </para>
+                        <para>
+                            Default: 60
+                        </para>
+                    </listitem>
+                </varlistentry>
             </variablelist>
         </refsect2>
 
@@ -975,6 +975,22 @@ override_homedir = /home/%u
                         </para>
                     </listitem>
                 </varlistentry>
+                <varlistentry>
+                    <term>force_timeout (integer)</term>
+                    <listitem>
+                        <para>
+                            If a service is not responding to ping checks (see
+                            the <quote>timeout</quote> option), it is first sent
+                            the SIGTERM signal that instructs it to quit gracefully.
+                            If the service does not terminate after <quote>force_timeout</quote>
+                            seconds, the monitor will forcibly shut it down by
+                            sending a SIGKILL signal.
+                        </para>
+                        <para>
+                            Default: 60
+                        </para>
+                    </listitem>
+                </varlistentry>
 
                 <varlistentry>
                     <term>entry_cache_timeout (integer)</term>
-- 
1.7.12.1

>From e0db92c70543330ff46213671889c9a2b5f8c10d Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgall...@redhat.com>
Date: Mon, 5 Nov 2012 10:21:23 -0500
Subject: [PATCH 1/3] Monitor: Better debugging for ping timeouts

---
 src/monitor/monitor.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c
index eef2fc7066c78c7994e05ea1579b483754ccc2d1..6a16bd93b0295505278e6ca2a391dc85121d61e1 100644
--- a/src/monitor/monitor.c
+++ b/src/monitor/monitor.c
@@ -903,6 +903,10 @@ static errno_t get_ping_config(struct mt_ctx *ctx, const char *path,
         svc->ping_time = MONITOR_DEF_PING_TIME;
     }
 
+    DEBUG(SSSDBG_CONF_SETTINGS,
+          ("Time between service pings for [%s]: [%d]\n",
+           svc->name, svc->ping_time));
+
     ret = confdb_get_int(ctx->cdb, path,
                          CONFDB_SERVICE_FORCE_TIMEOUT,
                          MONITOR_DEF_FORCE_TIME, &svc->kill_time);
@@ -917,6 +921,10 @@ static errno_t get_ping_config(struct mt_ctx *ctx, const char *path,
         svc->kill_time = MONITOR_DEF_FORCE_TIME;
     }
 
+    DEBUG(SSSDBG_CONF_SETTINGS,
+          ("Time between SIGTERM and SIGKILL for [%s]: [%d]\n",
+           svc->name, svc->kill_time));
+
     return EOK;
 }
 
-- 
1.7.12.1

_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to