]> git.proxmox.com Git - pve-manager.git/blame - bin/pvestatd
pve-manager.service: allow logging STDERR and STDOUT
[pve-manager.git] / bin / pvestatd
CommitLineData
776de3bc 1#!/usr/bin/perl
aff192e6
DM
2
3use strict;
776de3bc 4use warnings;
891d1242 5
d36acebb
DM
6use PVE::INotify;
7use PVE::RPCEnvironment;
780fbb4b 8use PVE::SafeSyslog;
b89ae9fc 9use PVE::Service::pvestatd;
aff192e6 10
780fbb4b
DM
11$SIG{'__WARN__'} = sub {
12 my $err = $@;
13 my $t = $_[0];
14 chomp $t;
15 print STDERR "$t\n";
16 syslog('warning', "%s", $t);
17 $@ = $err;
18};
19
d36acebb 20my $prepare = sub {
ae8b09bd 21 my $rpcenv = PVE::RPCEnvironment->init('priv');
aff192e6 22
d36acebb
DM
23 $rpcenv->init_request();
24 $rpcenv->set_language($ENV{LANG});
25 $rpcenv->set_user('root@pam');
26};
aff192e6 27
092fa1b0 28PVE::Service::pvestatd->run_cli_handler(prepare => $prepare);