httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Gifford <>
Subject Re: [users@httpd] CGI child processes
Date Wed, 16 Mar 2005 14:20:35 GMT
Jan Eden <> writes:

> I am trying to get a CGI script executed via Apache. The script
>should call another script and exit immediately, while the second
>script is still running in the background.


> How can I get Apache to disregard the process started by the CGI?

I believe you need to fork twice, so that the long-running process is
a child of init (not a child of Apache).  Something like (untested):

  if (!defined(my $f1 = fork()))
    die "fork failed: $!\n";
  elsif ($f1)
    # Parent
  elsif (!defined(my $f2 = fork()))
    die "second fork failed: $!\n";
  elsif ($f2)
    # Child
    # Grandchild


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message