Stas,
I had the following in my code:
my($nOrgPID) = fork;
exit if $nOrgPID;
die "Could not fork: $!" unless defined $nOrgPID;
close STDIN;
close STDOUT;
close STDERR;
setsid() or die "Could not start new session: $!";
but that didn't work, however when I changed it to this:
my($nOrgPID) = fork;
exit if $nOrgPID;
die "Could not fork: $!" unless defined $nOrgPID;
require 'sys/syscall.ph';
for (my $i=0; $i<=255; $i++) {
syscall(&SYS_close, $i + 0); # must force numeric
}
setsid() or die "Could not start new session: $!";
the socket got released and I could restart the server. I
know it is a little crud, but it seems to work.
Kees
- fork inherits socket connection Kees Vonk 7249 24549
- Re: fork inherits socket connection Stas Bekman
- Re: fork inherits socket connection Kees Vonk 7249 24549
- Re: fork inherits socket connection Stas Bekman
- Re: fork inherits socket connection Kees Vonk 7249 24549
- Re: fork inherits socket connec... Stas Bekman
- Re: fork inherits socket co... Jeremy Howard
- Re: fork inherits socke... Stas Bekman
- Re: fork inherits socke... Stas Bekman
- Re: fork inherits socke... Vivek Khera
- Re: fork inherits socke... Stas Bekman
- Re: fork inherits socket co... Kees Vonk 7249 24549
- Re: fork inherits socke... Stas Bekman
- Re: fork inherits socke... Kees Vonk 7249 24549
- Re: fork inherits socke... Stas Bekman
