Ahh, I see what you mean.  Unfortunatly this does not work on traditional
BSD (according to google).  The zombies are still created.

Here is a patch for FreeBSD.

--- pcpd.c      Sat Mar  1 01:19:08 2003
+++ pcpd.c.patched      Sat Mar  1 01:23:45 2003
@@ -2060,6 +2060,7 @@

 static void start()
 {
+       struct sigaction sa;
        int lockfd=ll_daemon_start(LOCKFILE);
        int pubsock;
        int privsock;
@@ -2082,7 +2083,11 @@

        ll_daemon_resetio();
        ll_daemon_started(PIDFILE, lockfd);
-       signal(SIGCHLD, SIG_IGN);
+
+       memset(&sa, 0, sizeof(sa));
+       sa.sa_handler=SIG_IGN;
+       sa.sa_flags=SA_NOCLDWAIT;
+       sigaction(SIGCHLD, &sa, NULL);

        for (;;)
        {


Thanks for the help.

Ben

----- Original Message -----
From: "Sam Varshavchik" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 28, 2003 11:42 PM
Subject: [sqwebmail] Re: zombie processes with pcpd


> Ben Pfountz writes:
>
> > Hello list,
> >
> > I am using sqwebmail with calendaring in groupware mode.  My OS is
FreeBSD
> > 4.7-STABLE.  It works really well, except that I have many pcpd zombie
> > processes that seem to collect as I browse through my callendar.  A
quick
> > scan through pcpd.c shows a call to fork when the pcpd server receives a
> > connection, but I cannot find a place where it then waits for the forked
> > process.  Am I missing something?  Is this done on purpose?
>
> SIGCHLD should be set to SIG_IGN:
>
>       signal(SIGCHLD, SIG_IGN);
>
> This should prevent accumulation of zombie processes.
>
>
>
>
>






-----
 Ben Pfountz
 Computer Science Undergraduate
 Virginia Tech

 Computer Systems Engineer
 Center for Power Electronic Systems
 Virginia Tech



Reply via email to