Re: Linux Installation
Posted in 1998
In article <6revf7$jpb$1@news.xmission.com> Sr. Leffler wrote:
% On Fri, 14 Aug 1998, Nils Myklebust wrote:
%> On Fri, 14 Aug 1998, Rob Zook <rzook@informix.com> wrote:
%> >Nils Myklebust wrote:
%> >> On Fri, 07 Aug 1998, Pieter Huyser <pieter@netsys.co.za> wrote:
[snip sqlexecd creates zombies]
%> >> I don't know of any workarround. May be others do?
%> >
%> >Here's a kludgie kind of workaround, create a cron job which
[snip bad idea to kill sqlexecd]
%> >zombies.
%>
[snip why killing sqlexecd is a bad idea]
% On the zombie issue, here's some speculative code (untested on Linux) which
% might relieve the problem.
% On SVR4, if the process ignores SIGCHLD, then no zombies are created. How
% about trying a wrapper program for sqlexecd which ignores SIGCHLD and then
% executes sqlexecd:
% #include <signal.h>
% #include <unistd.h>
% #include <stdio.h>
% int main(int argc, char **argv)
% {
% signal(SIGCHLD, SIG_IGN);
% execv(argv[1], &argv[1]);
% fprintf(stderr, "Failed to execv() %s\\n", argv[1]);
% return 1;
% }
I compiled the above code, with an extra fprintf() above signal() so
I could see how it was being called.
% You could replace the execv() with an execvp() if desired, but it is not
% likely to be all that helpful. Compile this code as nozombie and then run
% it as:
I used execv()...
% nozombie $INFORMIXDIR/lib/sqlexecd [servicename]
It worked as expected: starting and ending multiple (4) dbaccess sessions
(sequentially) left no zombies in the process table.
% I think it's worth a try -- it will work unless sqlexecd explicitly
% reenables child termination signal handling or Linux doesn't support the
% SVR4 model for handling SIGCHLD and zombies (which is unlikely since it is
% definitely part of Unix-98 and probably part of POSIX.1). Does Linux have
% an equivalent to truss which would tell you whether sqlexecd is calling the
% signal handlers to set a handler for SIGCHLD?
There may be a "truss" out there for Linux, but I used "strace" to track the
system calls. I issued a SIGHUP to the sqlexecd process and got
the following:
munmap(0x40008000, 4096) = 0
brk(0x80ba000) = 0x80ba000
getuid() = 0
sigaction(SIGCHLD, {0x8049f20, [], SA_INTERRUPT|SA_NOMASK|SA_ONESHOT}, {SIG_DFL}) = 0
fork() = 3950
_exit(0) = ?
I don't know if this tells you what you want to know, but I hope it helps,
anyway.
Kurt Wall
--
I love the smell of ozone in the morning.