- delete $ENV{RESTART_PVE_FIREWALL};
-
- PVE::Cluster::cfs_update();
-
- PVE::Firewall::init();
-
- if (!$param->{debug}) {
- open STDIN, '</dev/null' || die "can't read /dev/null";
- open STDOUT, '>/dev/null' || die "can't write /dev/null";
- }
-
- if (!$restart && !$param->{debug}) {
- $spid = fork();
- if (!defined ($spid)) {
- my $msg = "can't put server into background - fork failed";
- syslog('err', $msg);
- die "ERROR: $msg\n";
- } elsif ($spid) { # parent
- exit (0);
- }
- }
-
- writepidfile($pve_firewall_pidfile);
-
- open STDERR, '>&STDOUT' || die "can't close STDERR\n";
-
- $SIG{INT} = $SIG{TERM} = $SIG{QUIT} = sub {
- syslog('info' , "server closing");
-
- $SIG{INT} = 'DEFAULT';
-
- # wait for children
- 1 while (waitpid(-1, POSIX::WNOHANG()) > 0);