mirror of
https://git.proxmox.com/git/pve-common
synced 2025-07-25 20:07:34 +00:00
run_cli_handler: add no_init for lxc mount hook
This commit is contained in:
parent
5ae87c41eb
commit
5ffbe2f10a
@ -482,11 +482,13 @@ sub run_cli_handler {
|
||||
foreach my $key (keys %params) {
|
||||
next if $key eq 'podfn';
|
||||
next if $key eq 'prepare';
|
||||
next if $key eq 'no_init'; # used by lxc hooks
|
||||
die "unknown parameter '$key'";
|
||||
}
|
||||
|
||||
my $podfn = $params{podfn};
|
||||
my $preparefunc = $params{prepare};
|
||||
my $no_init = $params{no_init};
|
||||
|
||||
my $pwcallback = $class->can('read_password');
|
||||
|
||||
@ -497,10 +499,10 @@ sub run_cli_handler {
|
||||
if ($class !~ m/^PVE::Service::/) {
|
||||
die "please run as root\n" if $> != 0;
|
||||
|
||||
PVE::INotify::inotify_init();
|
||||
PVE::INotify::inotify_init() if !$no_init;
|
||||
|
||||
my $rpcenv = PVE::RPCEnvironment->init('cli');
|
||||
$rpcenv->init_request();
|
||||
$rpcenv->init_request() if !$no_init;
|
||||
$rpcenv->set_language($ENV{LANG});
|
||||
$rpcenv->set_user('root@pam');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user