Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > 9bc5442986852b4b0f56543d61a770fc > files > 11

perl-Proc-Fork-0.802.0-2.mga4.noarch.rpm

use strict;
use Proc::Fork;
use POSIX;

# One-stop shopping: fork, die on error, parent process exits.
run_fork { parent { exit } };

# Other daemon initialization activities.
$SIG{INT} = $SIG{TERM} = $SIG{HUP} = $SIG{PIPE} = \&some_signal_handler;
POSIX::setsid() or die "Cannot start a new session: $!\n";
close $_ for *STDIN, *STDOUT, *STDERR;

# rest of daemon program follows