From 33d7292f29bedfd7570bebcef2a5d6943ebe8cbb Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Sat, 3 Jul 2021 21:03:13 +0200 Subject: [PATCH] restore daemon: create /run/proxmox-backup on startup fixes file restore again. The new Memcom tracking file lives in `/run/proxmox-backup` and is always created on REST interaction, as CachedUserInfo uses it to efficiently track config changes, and such a cache is used in each REST handle_request. Further, the Memcom infra expects the base run PBS dir to exists already, which is an OK assumption to have, but in the file-restore daemon we have a significantly more minimal environment, and the run dir was simply not required there, even /run isn't a tmpfs yet. Fixes fda19dcc6f4 ("fix CachedUserInfo by using a shared memory version counter") Signed-off-by: Thomas Lamprecht --- src/bin/proxmox-restore-daemon.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/proxmox-restore-daemon.rs b/src/bin/proxmox-restore-daemon.rs index 93a12c3a..2589e2d8 100644 --- a/src/bin/proxmox-restore-daemon.rs +++ b/src/bin/proxmox-restore-daemon.rs @@ -48,6 +48,10 @@ fn main() -> Result<(), Error> { .write_style(env_logger::WriteStyle::Never) .init(); + // the API may save some stuff there, e.g., the memcon tracking file + // we do not care much, but it's way less headache to just create it + std::fs::create_dir_all("/run/proxmox-backup")?; + // scan all attached disks now, before starting the API // this will panic and stop the VM if anything goes wrong info!("scanning all disks...");