G
ganchrow
I have a CGI script written Perl, the only function of which, is to
start a Perl Daemon. My OS is Red Hat. Here's the pseudo code:
---------------------------------------
#!/usr/local/bin/perl
# run under Red Hat
print "Content-Type: text/html\n\n<body>";
print "BEGIN PAGE<BR>\n";
if (system("perl $CMD_WHICH_STARTS_OTHER_PERL_SCRIPT &")) {
print "Program not started: $!<BR>\n";
} else {
print "Program started.<BR>\n";
}
print "END PAGE<BR>\n";
print "</body>";
---------------------------------------
Now the problem is that even though the new process succesfully starts
in the background, the CGI does not terminate -- the page still shows
as "loading" in the web browser and running "ps -x" at a command prompt
shows that the cgi process is running as a zombie process.
Any idea what I can so that once the final line of the CGI script is
reached the program terminates (with the spawned process continuing
until it dies of its own natural causes)?
Many Thanks,
GANCH.
start a Perl Daemon. My OS is Red Hat. Here's the pseudo code:
---------------------------------------
#!/usr/local/bin/perl
# run under Red Hat
print "Content-Type: text/html\n\n<body>";
print "BEGIN PAGE<BR>\n";
if (system("perl $CMD_WHICH_STARTS_OTHER_PERL_SCRIPT &")) {
print "Program not started: $!<BR>\n";
} else {
print "Program started.<BR>\n";
}
print "END PAGE<BR>\n";
print "</body>";
---------------------------------------
Now the problem is that even though the new process succesfully starts
in the background, the CGI does not terminate -- the page still shows
as "loading" in the web browser and running "ps -x" at a command prompt
shows that the cgi process is running as a zombie process.
Any idea what I can so that once the final line of the CGI script is
reached the program terminates (with the spawned process continuing
until it dies of its own natural causes)?
Many Thanks,
GANCH.