]> git.proxmox.com Git - pve-container.git/blobdiff - src/lxc-pve-prestart-hook
prestart & poststop hook: init REST environment, e.g. for storage activation
[pve-container.git] / src / lxc-pve-prestart-hook
index 0a76aee90ed36837dcda4a269d784427404b6889..2911e1be7bb7587eb0e820a4cc3083efa3bc1cd8 100755 (executable)
@@ -15,6 +15,7 @@ use PVE::LXC::Config;
 use PVE::LXC::Setup;
 use PVE::LXC::Tools;
 use PVE::LXC;
+use PVE::RESTEnvironment;
 use PVE::SafeSyslog;
 use PVE::Storage;
 use PVE::Syscall qw(:fsmount);
@@ -39,6 +40,8 @@ PVE::LXC::Tools::lxc_hook('pre-start', 'lxc', sub {
 
     PVE::Cluster::check_cfs_quorum(); # only start if we have quorum
 
+    PVE::RESTEnvironment->setup_default_cli_env();
+
     return undef if ! -f PVE::LXC::Config->config_file($vmid);
 
     my $conf = PVE::LXC::Config->load_config($vmid);