Hi,
I'm using Embperl 1.3.4 with mod_perl 1.27 and apache 1.3 on linux 2.4.
Now I need to fork() in a page to spawn off a long-running process
(cdrecord, basically). I used the stuff from the mod_perl docs:
sub start_burning() {
require POSIX;
$SIG{CHLD} = 'IGNORE';
defined (my $kid = fork) or die "Cannot fork: $!\n";
return if $kid;
chdir '/';
$0 = 'burner-process';
close STDOUT;
close STDERR;
close STDIN;
POSIX::setsid();
TEMA::secure_system('/usr/bin/cdrecord.wrap', $nn);
CORE::exit(0);
}
never mind the secure_system stuff, it is basically
system { '/usr/bin/cdrecord.wrap' } '/usr/bin/cdrecord.wrap', $nn;
now this works fine, but after the first run, further accesses lock up.
Even restarting apache, every access will freeze up. I'm 99% sure that's
because the semaphore lock on the session isn't released, and now I'm
looking for a way to _really, absolutely_ detach the burner process from
the apache/embperl process.
I'm not too keen on writing a cdrecord daemon which listens on a unix
domain socket or anything, since that would be another point of failure.
Thanks for your help,
Torsten <[EMAIL PROTECTED]>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]