[wellylug] Setting a process going through apache

Donald Gordon don at dis.org.nz
Thu Jun 30 09:30:54 NZST 2005


On Wed, 29 Jun 2005 22:20:16 +1200, "Ian Beardslee" <itb at falcons.co.nz> wrote:

> So, how can I use the browser to get apache to get a perl script running
> as a seperate process in the background?  You know, click 'go' and it
> comes back saying your report should be in your inbox in 10 minutes type
> thing?

Ah.  I came across this problem a while ago; the following seems to
work for me:

    # display your Please Wait screen...

    if (fork()) {
        close STDOUT;
        close STDIN;
        exit(0);
    } # else

    close STDOUT;
    close STDIN;

    # long-running stuff goes here

donald




More information about the wellylug mailing list