mirror of
https://git.proxmox.com/git/pve-common
synced 2025-07-27 06:34:02 +00:00
run_cli: skip environment init for PVE::Service::* classes
This is done by the daemon implementation instead.
This commit is contained in:
parent
edf3d572aa
commit
2a8ced7bac
@ -372,14 +372,17 @@ sub run_cli {
|
|||||||
|
|
||||||
initlog($exename);
|
initlog($exename);
|
||||||
|
|
||||||
die "please run as root\n" if $> != 0;
|
|
||||||
|
|
||||||
PVE::INotify::inotify_init() if $class !~ m/^PVE::Service::/;
|
if ($class !~ m/^PVE::Service::/) {
|
||||||
|
die "please run as root\n" if $> != 0;
|
||||||
|
|
||||||
my $rpcenv = PVE::RPCEnvironment->init('cli');
|
PVE::INotify::inotify_init();
|
||||||
$rpcenv->init_request();
|
|
||||||
$rpcenv->set_language($ENV{LANG});
|
my $rpcenv = PVE::RPCEnvironment->init('cli');
|
||||||
$rpcenv->set_user('root@pam');
|
$rpcenv->init_request();
|
||||||
|
$rpcenv->set_language($ENV{LANG});
|
||||||
|
$rpcenv->set_user('root@pam');
|
||||||
|
}
|
||||||
|
|
||||||
no strict 'refs';
|
no strict 'refs';
|
||||||
my $def = ${"${class}::cmddef"};
|
my $def = ${"${class}::cmddef"};
|
||||||
|
Loading…
Reference in New Issue
Block a user