<div dir="ltr">Guys,<div><br></div><div>No-one ever responded to this thread (years ago).</div><div>We have just noticed the same problem on a newer version of Debian and we are going to dig up our old patch and use it.</div><div>This is an issue for services like rpcbind for which systemd uses the older SysV init scripts.  </div><div><br></div><div>Dan</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 10, 2013 at 2:11 PM, Daniel Povey <span dir="ltr"><<a href="mailto:dpovey@gmail.com" target="_blank">dpovey@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I am sending a patch to the source of "killall5" that I am using<br>
locally.  It basically ignores all processes in a "D" or "Z" state (or<br>
states where D or Z appear in the string).  This is of course not<br>
ideal, but it works for me.  I found that not all machines where I had<br>
stuck processes, would cause problems for start-stop-daemon-- this<br>
patch is only for "pidof".  I may later replicate the problem with<br>
start-stop-daemon and figure out a fix.<br>
<br>
<br>
root@a04:~# diff -c sysvinit-2.88dsf/src/killall5.<wbr>c<br>
sysvinit-2.88dsf-modified/src/<wbr>killall5.c<br>
*** sysvinit-2.88dsf/src/killall5.<wbr>c     Sat Aug 10 17:05:31 2013<br>
--- sysvinit-2.88dsf-modified/src/<wbr>killall5.c    Sat Aug 10 16:50:27 2013<br>
***************<br>
*** 1,5 ****<br>
  /*<br>
!  * kilall5.c  Kill all processes except processes that have the<br>
   *            same session id, so that the shell that called us<br>
   *            won't be killed. Typically used in shutdown scripts.<br>
   *<br>
--- 1,5 ----<br>
  /*<br>
!  * killall5.c Kill all processes except processes that have the<br>
   *            same session id, so that the shell that called us<br>
   *            won't be killed. Typically used in shutdown scripts.<br>
   *<br>
***************<br>
*** 536,548 ****<br>
                        p->statname = (char *)xmalloc(strlen(s)+1);<br>
                        strcpy(p->statname, s);<br>
<br>
                        /* Get session, startcode, endcode. */<br>
                        startcode = endcode = 0;<br>
!                       if (sscanf(q,   "%*c %*d %*d %d %*d %*d %*u %*u "<br>
                                        "%*u %*u %*u %*u %*u %*d %*d "<br>
                                        "%*d %*d %*d %*d %*u %*u %*d "<br>
                                        "%*u %lu %lu",<br>
!                                       &p->sid, &startcode, &endcode) != 3) {<br>
                                p->sid = 0;<br>
                                nsyslog(LOG_ERR, "can't read sid from %s\n",<br>
                                        path);<br>
--- 536,550 ----<br>
                        p->statname = (char *)xmalloc(strlen(s)+1);<br>
                        strcpy(p->statname, s);<br>
<br>
+                       char status[11];<br>
+<br>
                        /* Get session, startcode, endcode. */<br>
                        startcode = endcode = 0;<br>
!                       if (sscanf(q,   "%10s %*d %*d %d %*d %*d %*u %*u "<br>
                                        "%*u %*u %*u %*u %*u %*d %*d "<br>
                                        "%*d %*d %*d %*d %*u %*u %*d "<br>
                                        "%*u %lu %lu",<br>
!                                       status, &p->sid, &startcode,<br>
&endcode) != 4) {<br>
                                p->sid = 0;<br>
                                nsyslog(LOG_ERR, "can't read sid from %s\n",<br>
                                        path);<br>
***************<br>
*** 555,560 ****<br>
--- 557,571 ----<br>
                        if (startcode == 0 && endcode == 0)<br>
                                p->kernel = 1;<br>
                        fclose(fp);<br>
+                       if (strchr(status, 'D') != NULL ||<br>
strchr(status, 'Z') != NULL) {<br>
+                         /* Ignore zombie processes or processes in<br>
disk sleep, as attempts<br>
+                            to access the stats of these will<br>
sometimes fail. */<br>
+                         if (p->argv0) free(p->argv0);<br>
+                         if (p->argv1) free(p->argv1);<br>
+                         if (p->statname) free(p->statname);<br>
+                         free(p);<br>
+                         continue;<br>
+                       }<br>
                } else {<br>
                        /* Process disappeared.. */<br>
                        if (p->argv0) free(p->argv0);<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
On Fri, Aug 9, 2013 at 7:33 PM, Debian Bug Tracking System<br>
<<a href="mailto:owner@bugs.debian.org">owner@bugs.debian.org</a>> wrote:<br>
> Thank you for filing a new Bug report with Debian.<br>
><br>
> This is an automatically generated reply to let you know your message<br>
> has been received.<br>
><br>
> Your message is being forwarded to the package maintainers and other<br>
> interested parties for their attention; they will reply in due course.<br>
><br>
> Your message has been sent to the package maintainer(s):<br>
>  Debian sysvinit maintainers <<a href="mailto:pkg-sysvinit-devel@lists.alioth.debian.org">pkg-sysvinit-devel@lists.<wbr>alioth.debian.org</a>><br>
><br>
> If you wish to submit further information on this problem, please<br>
> send it to <a href="mailto:719273@bugs.debian.org">719273@bugs.debian.org</a>.<br>
><br>
> Please do not send mail to <a href="mailto:owner@bugs.debian.org">owner@bugs.debian.org</a> unless you wish<br>
> to report a problem with the Bug-tracking system.<br>
><br>
> --<br>
> 719273: <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719273" rel="noreferrer" target="_blank">http://bugs.debian.org/cgi-<wbr>bin/bugreport.cgi?bug=719273</a><br>
> Debian Bug Tracking System<br>
> Contact <a href="mailto:owner@bugs.debian.org">owner@bugs.debian.org</a> with problems<br>
</div></div></blockquote></div><br></div>