From 5ffbe2f10ac9c4b7f95cfde9ff91e542ac32b07c Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Fri, 2 Oct 2015 13:41:15 +0200 Subject: [PATCH] run_cli_handler: add no_init for lxc mount hook --- src/PVE/CLIHandler.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PVE/CLIHandler.pm b/src/PVE/CLIHandler.pm index c62837b..f973bdc 100644 --- a/src/PVE/CLIHandler.pm +++ b/src/PVE/CLIHandler.pm @@ -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'); } -- 2.39.2