worker task: allow to configure path and owner/group

And application now needs to call init_worker_tasks() before using
worker tasks.

Notable changes:
- need to call  init_worker_tasks() before using worker tasks.
- create_task_log_dirs() ís called inside init_worker_tasks()
- removed UpidExt trait
- use atomic_open_or_create_file()
- remove pbs_config and pbs_buildcfg dependency
This commit is contained in:
Dietmar Maurer
2021-09-22 08:44:48 +02:00
parent 049a22a3a3
commit 0a33fba49c
6 changed files with 290 additions and 224 deletions

View File

@ -54,8 +54,6 @@ async fn run() -> Result<(), Error> {
bail!("unable to inititialize syslog - {}", err);
}
server::create_task_log_dirs()?;
config::create_configdir()?;
config::update_self_signed_cert(false)?;
@ -102,13 +100,14 @@ async fn run() -> Result<(), Error> {
config.enable_auth_log(
pbs_buildcfg::API_AUTH_LOG_FN,
Some(dir_opts),
Some(file_opts),
Some(dir_opts.clone()),
Some(file_opts.clone()),
&mut commando_sock,
)?;
let rest_server = RestServer::new(config);
proxmox_backup::server::init_worker_tasks(pbs_buildcfg::PROXMOX_BACKUP_LOG_DIR_M!().into(), file_opts.clone())?;
// http server future:
let server = daemon::create_daemon(

View File

@ -202,12 +202,13 @@ async fn run() -> Result<(), Error> {
config.enable_auth_log(
pbs_buildcfg::API_AUTH_LOG_FN,
Some(dir_opts),
Some(file_opts),
Some(dir_opts.clone()),
Some(file_opts.clone()),
&mut commando_sock,
)?;
let rest_server = RestServer::new(config);
proxmox_backup::server::init_worker_tasks(pbs_buildcfg::PROXMOX_BACKUP_LOG_DIR_M!().into(), file_opts.clone())?;
//openssl req -x509 -newkey rsa:4096 -keyout /etc/proxmox-backup/proxy.key -out /etc/proxmox-backup/proxy.pem -nodes