file logger: add option to make the backup user the log file owner

and use that in ApiConfig to avoid that it is owned by root if the
proxmox-backup-api process creates it first.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht
2020-10-19 10:35:54 +02:00
parent bb14d46796
commit c7e18ba08a
2 changed files with 11 additions and 1 deletions

View File

@ -139,6 +139,7 @@ impl ApiConfig {
let logger_options = FileLogOptions {
append: true,
owned_by_backup: true,
..Default::default()
};
self.request_log = Some(Mutex::new(FileLogger::new(&path, logger_options)?));