3 $ENV{'PATH'} = '/sbin:/bin:/usr/sbin:/usr/bin';
5 delete @ENV{qw(IFS CDPATH ENV BASH_ENV)};
13 use PVE
::API2
::Formatter
::Standard
;
14 use PVE
::API2
::Formatter
::HTML
;
17 use base
qw(PVE::Daemon);
19 $SIG{'__WARN__'} = sub {
24 syslog
('warning', "%s", $t);
28 my $cmdline = [$0, @ARGV];
30 my %daemon_options = (
32 restart_on_error
=> 5,
34 leave_children_open_on_reload
=> 1,
37 # create dir for dtach sockets
38 mkdir "/var/run/dtach";
40 my $daemon = __PACKAGE__-
>new('pvedaemon', $cmdline, %daemon_options);
45 my $accept_lock_fn = "/var/lock/pvedaemon.lck";
47 my $lockfh = IO
::File-
>new(">>${accept_lock_fn}") ||
48 die "unable to open lock file '${accept_lock_fn}' - $!\n";
50 my $socket = $self->create_reusable_socket(85, '127.0.0.1');
52 $self->{server_config
} = {
53 base_handler_class
=> 'PVE::API2',
57 lockfile
=> $accept_lock_fn,
60 debug
=> $self->{debug
},
68 my $server = PVE
::HTTPServer-
>new(%{$self->{server_config
}});
72 $daemon->register_start_command();
73 $daemon->register_restart_command(1);
74 $daemon->register_stop_command();
75 $daemon->register_status_command();
78 start
=> [ __PACKAGE__
, 'start', []],
79 restart
=> [ __PACKAGE__
, 'restart', []],
80 stop
=> [ __PACKAGE__
, 'stop', []],
81 status
=> [ __PACKAGE__
, 'status', [], undef, sub { print shift . "\n";} ],
86 PVE
::CLIHandler
::handle_cmd
($cmddef, $0, $cmd, \
@ARGV, undef, $0);
94 pvedaemon - the PVE configuration server
100 All configuration is done using this Server. The Server only
101 listens to a local address 127.0.0.1 port 85 for security
104 =include pve_copyright