[pbs-devel] [PATCH backup] tape: create drive-state and changer-state directories with correct permissions

Dietmar Maurer dietmar at proxmox.com
Thu May 6 08:24:34 CEST 2021


Or just create the rundir at daemon startup?

diff --git a/src/bin/proxmox-backup-api.rs b/src/bin/proxmox-backup-api.rs
index e514a801..f50a04a5 100644
--- a/src/bin/proxmox-backup-api.rs
+++ b/src/bin/proxmox-backup-api.rs
@@ -39,6 +39,8 @@ async fn run() -> Result<(), Error> {
 
     config::update_self_signed_cert(false)?;
 
+    proxmox_backup::tools::create_run_dir()?;
+
     proxmox_backup::rrd::create_rrdb_dir()?;
     proxmox_backup::server::jobstate::create_jobstate_dir()?;
     proxmox_backup::tape::create_tape_status_dir()?;



> On 05/04/2021 3:10 PM Oguz Bektas <o.bektas at proxmox.com> wrote:
> 
>  
> we need to also pass the intermediate_opts to avoid creating
> /run/proxmox-backup/ with root as owner (in case it does not exist yet)
> 
> Signed-off-by: Oguz Bektas <o.bektas at proxmox.com>
> ---
>  src/tape/mod.rs | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/tape/mod.rs b/src/tape/mod.rs
> index ed03d8a7..de15800f 100644
> --- a/src/tape/mod.rs
> +++ b/src/tape/mod.rs
> @@ -85,7 +85,7 @@ pub fn create_drive_state_dir() -> Result<(), Error> {
>          .owner(backup_user.uid)
>          .group(backup_user.gid);
>  
> -    create_path(DRIVE_STATE_DIR, None, Some(options))
> +    create_path(DRIVE_STATE_DIR, Some(options.clone()), Some(options))
>          .map_err(|err: Error| format_err!("unable to create drive state dir - {}", err))?;
>  
>      Ok(())
> @@ -100,7 +100,7 @@ pub fn create_changer_state_dir() -> Result<(), Error> {
>          .owner(backup_user.uid)
>          .group(backup_user.gid);
>  
> -    create_path(CHANGER_STATE_DIR, None, Some(options))
> +    create_path(CHANGER_STATE_DIR, Some(options.clone()), Some(options))
>          .map_err(|err: Error| format_err!("unable to create changer state dir - {}", err))?;
>  
>      Ok(())
> -- 
> 2.20.1
> 
> 
> _______________________________________________
> pbs-devel mailing list
> pbs-devel at lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel





More information about the pbs-devel mailing list