pve-manager/bin/pvestatd
2016-10-26 15:58:23 +02:00

29 lines
532 B
Perl
Executable File

#!/usr/bin/perl
use strict;
use warnings;
use PVE::INotify;
use PVE::RPCEnvironment;
use PVE::SafeSyslog;
use PVE::Service::pvestatd;
$SIG{'__WARN__'} = sub {
my $err = $@;
my $t = $_[0];
chomp $t;
print STDERR "$t\n";
syslog('warning', "%s", $t);
$@ = $err;
};
my $prepare = sub {
my $rpcenv = PVE::RPCEnvironment->init('priv');
$rpcenv->init_request();
$rpcenv->set_language($ENV{LANG});
$rpcenv->set_user('root@pam');
};
PVE::Service::pvestatd->run_cli_handler(prepare => $prepare);