<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
<br><br><div><div id="SkyDrivePlaceholder"></div>Date: Wed, 28 Nov 2012 15:10:17 +0100<br>From: jhrozek@redhat.com<br>To: sssd-devel@lists.fedorahosted.org<br>Subject: Re: [SSSD] [PATCH] when monitor_quit is call and the process not exists<br><br><pre>On Thu, Nov 22, 2012 at 12:48:25PM -0500, Ariel Barria wrote:<br>&gt; <br>&gt; <br>&gt; <br>&gt; &gt; Date: Thu, 22 Nov 2012 15:42:59 +0100<br>&gt; &gt; From: jhrozek@redhat.com<br>&gt; &gt; To: sssd-devel@lists.fedorahosted.org<br>&gt; &gt; Subject: Re: [SSSD] [PATCH] when monitor_quit is call and the process not exists<br>&gt; &gt; <br>&gt; &gt; On Wed, Nov 21, 2012 at 03:15:43PM -0500, Ariel Barria wrote:<br>&gt; &gt; &gt; <br>&gt; &gt; &gt; Hi.<br>&gt; &gt; &gt; well, I'm not sure that this patch have the behavior that is it hope. You have the word.<br>&gt; &gt; &gt; But when monitor_quit is call and the process not exists, this remains in loop and not allow signal.<br>&gt; &gt; &gt; I try it with Monitor Task and nothing. <br>&gt; &gt; &gt; I had to reboot                                               <br>&gt; &gt; <br>&gt; &gt; Thanks a lot, Ariel, this is quite a bad bug. The concept is good, but<br>&gt; &gt; can you change the patch a little?<br>&gt; &gt; <br>&gt; &gt; instead of:<br>&gt; &gt;  if (error != EINTR) {<br>&gt; &gt;     kill()<br>&gt; &gt;     if (error == ESRCH || error == ECHILD) {<br>&gt; &gt;         killed = true;<br>&gt; &gt;     }<br>&gt; &gt;  }<br>&gt; <br>&gt; <br>&gt; OK.<br>&gt; <br>&gt; &gt; I would use:<br>&gt; &gt;     if (error == ECHILD) {<br>&gt; &gt;         /* Skip this process */<br>&gt; &gt;         killed = true;<br>&gt; &gt;     } else if (error != EINTR) {<br>&gt; &gt;         /* Keep the block with the kill function around */<br>&gt; &gt;     }<br>&gt; &gt; <br>&gt; <br>&gt; <br>&gt; &gt; Also, are you sure about the ESRCH error code? The waitpid man page only<br>&gt; &gt; mentions ECHILD..<br>&gt; <br>&gt; <br>&gt; well, really not is waipit.<br>&gt; For example 1<br>&gt; (Thu Nov 22 10:17:44 2012) [sssd] [monitor_quit] (0x0040): Returned with: 1<br>&gt; (Thu Nov 22 10:17:44 2012) [sssd] [monitor_quit] (0x0020): Terminating [pam][7494]<br>&gt; (Thu Nov 22 10:17:44 2012) [sssd] [monitor_quit] (0x0020): Couldn't kill [pam][7494]: [3] [No such process] *********<br>&gt; (Thu Nov 22 10:17:44 2012) [sssd] [monitor_quit] (0x0010): [10][No child processes] while waiting for [pam] ****waitpid<br>&gt; (Thu Nov 22 10:17:44 2012) [sssd] [monitor_quit] (0x0020): Terminating [ssh][7493]<br>&gt; (Thu Nov 22 10:17:44 2012) [sssd] [monitor_quit] (0x0020): Couldn't kill [ssh][7493]: [3] [No such process]<br>&gt; (Thu Nov 22 10:17:44 2012) [sssd] [monitor_quit] (0x0010): [10][No child processes] while waiting for [ssh]<br>&gt; (Thu Nov 22 10:17:44 2012) [sssd] [monitor_quit] (0x0020): Terminating [nss][7492]<br>&gt; (Thu Nov 22 10:17:44 2012) [sssd] [monitor_quit] (0x0020): Couldn't kill [nss][7492]: [3] [No such process]<br>&gt; (Thu Nov 22 10:17:44 2012) [sssd] [monitor_quit] (0x0010): [10][No child processes] while waiting for [nss]<br>&gt; (Thu Nov 22 10:17:44 2012) [sssd] [sbus_remove_watch] (0x2000): 0x9ee5f0/0x9f1430<br>&gt; <br>&gt; I think that if the process not exists, is not necessary waitpit. you is agree?<br>&gt; Based on this, the result would be:<br>&gt; Example 2 <br>&gt; Returned with: 1<br>&gt; (Thu Nov 22 12:42:37 2012) [sssd] [monitor_quit] (0x0020): Terminating [nss][27350]<br>&gt; (Thu Nov 22 12:42:37 2012) [sssd] [monitor_quit] (0x0020): Couldn't kill [nss][27350]: [No such process]<br>&gt; (Thu Nov 22 12:42:37 2012) [sssd] [monitor_quit] (0x0020): Terminating [ssh][27349]<br>&gt; (Thu Nov 22 12:42:37 2012) [sssd] [monitor_quit] (0x0020): Couldn't kill [ssh][27349]: [No such process]<br>&gt; (Thu Nov 22 12:42:37 2012) [sssd] [monitor_quit] (0x0020): Terminating [pam][27348]<br>&gt; (Thu Nov 22 12:42:37 2012) [sssd] [monitor_quit] (0x0020): Couldn't kill [pam][27348]: [No such process]<br>&gt; (Thu Nov 22 12:42:37 2012) [sssd] [sbus_remove_watch] (0x2000): 0x237a080/0x237beb0<br>&gt; <br>&gt; <br>&gt; otherwise (only ECHILD),  the result would be how the first example.<br>&gt; <br> <br>I don't think having that extra line really matters, it's just a DEBUG<br>message (and only in the case when the configuration is wrong anyway).<br> <br>What about the attached patch? It's the one you sent earlier with a<br>modification. Would you agree with that version? Would it fix the<br>problem for you?<br><br>Yes, this fix the problem :)<br>Thanks for comments and your time.<br></pre><br>_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/sssd-devel</div>                                               </div></body>
</html>