W
Wolfgang Hennerbichler
Hi perl-people.
I have a process that forks itself by closing the STD[IN|OUT|ERR]
Filehandles, and killing the parent.
This somehow works like this:
close STDIN or die "Can't close STDIN: $!";
close STDERR or die "Can't close STDERR: $!";
close STDOUT or die "Can't close STDOUT: $!";
my $pid=fork();
if ($pid) {
exit;
}
&error ("can't fork: $!") if not defined $pid;
setsid() or die "Can't start a new Session: $!";
Well, that's cool. Unfortunately this process has a lot of forking to
do, and therefore it would be great (especially for monitoring
reasons) if I could rename the daemons (so that they appear with
different names when I do a 'ps auxc' for example) that fork off. The
OS is Linux 2.6, and I can't find much information about that on the
web. Could you please advise?
Thanks in advance,
wogri
I have a process that forks itself by closing the STD[IN|OUT|ERR]
Filehandles, and killing the parent.
This somehow works like this:
close STDIN or die "Can't close STDIN: $!";
close STDERR or die "Can't close STDERR: $!";
close STDOUT or die "Can't close STDOUT: $!";
my $pid=fork();
if ($pid) {
exit;
}
&error ("can't fork: $!") if not defined $pid;
setsid() or die "Can't start a new Session: $!";
Well, that's cool. Unfortunately this process has a lot of forking to
do, and therefore it would be great (especially for monitoring
reasons) if I could rename the daemons (so that they appear with
different names when I do a 'ps auxc' for example) that fork off. The
OS is Linux 2.6, and I can't find much information about that on the
web. Could you please advise?
Thanks in advance,
wogri