[Fwd: Re: does nozombie work for anybody on Linux?]
Posted in 1998
This is a multi-part message in MIME format. --------------5B972C467F43 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Thought the larger community might want to see Jim's solution... --------------5B972C467F43 Content-Type: message/news Content-Transfer-Encoding: 7bit Content-Disposition: inline Path: www.informix.com!not-for-mail From: "Jim" <xxx> Newsgroups: informix.idn.linux Subject: Re: does nozombie work for anybody on Linux? Date: Tue, 20 Oct 1998 22:29:10 -0400 Organization: Informix Software, Inc. Message-ID: <70jgom$s3r1@www.informix.com> References: <362BFA39.49416C1A@datarithm.com> NNTP-Posting-Host: 24.131.49.159 X-Newsreader: Microsoft Outlook Express 4.72.3155.0 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3155.0 The following works (at least on a libc5 system): 1. Create signalfix.c as: #include "signal.h" #include <unistd.h> #include <stdio.h> void *signal(int signum,void (*handler)(int)) { struct sigaction sa; sa.sa_handler=handler; sa.sa_mask=SA_NOMASK; sa.sa_flags=SA_RESTART; sigaction(signum,&sa,(struct sigaction *)NULL); } 2. Copy /usr/include/signal.h, and comment out the signal function. 3. Compile signalfix.c with: gcc -fpic -shared signalfix.c -o libsig.so 4. Run sqlexecd with: LD_PRELOAD=/root/sqlexecfix/libsig.so $INFORMIXDIR/lib/sqlexecd servername -l /tmp/servername.log 5. No more zombies! Robert Read wrote in message <362BFA39.49416C1A@datarithm.com>... >The "nozombie" kludge mentioned in the FAQ does not work for me. >I've seen posts from others who can't get it to work. The FAQ >even mentions this. Has anyone had success with nozombie on >Linux? If so, what flavor? > >When signal is used to set a signal handler, the handler is reset >to the default whenever the signal handler is called. (This is >the common behavior on SysV systems, but not on BSD.) This >explains why the first connection does not leave a >zombie---sqlexecd handles the first SIGCHLD and then the handler >is reset to the default---and the rest of the connections become >zombies. The nozombie program also uses signal, so it would have >the same problem. I modified nozombie.c to use sigaction, but it >didn't help. When sqlexecd calls signal, it must override the >effects of sigaction. > >It seems to me that the only fix we can do is to change libc so >that signal calls the bsd version mentioned in the man page. Does >anybody have a better idea? > >robert --------------5B972C467F43--