all lists on lists.proxmox.com
 help / color / mirror / Atom feed
* Re: [pbs-devel] [PATCH backup] tape: create drive-state and changer-state directories with correct permissions
@ 2021-05-06  6:24 Dietmar Maurer
  0 siblings, 0 replies; 2+ messages in thread
From: Dietmar Maurer @ 2021-05-06  6:24 UTC (permalink / raw)
  To: Proxmox Backup Server development discussion, Oguz Bektas

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@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@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@lists.proxmox.com
> https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel




^ permalink raw reply	[flat|nested] 2+ messages in thread

* [pbs-devel] [PATCH backup] tape: create drive-state and changer-state directories with correct permissions
@ 2021-05-04 13:10 Oguz Bektas
  0 siblings, 0 replies; 2+ messages in thread
From: Oguz Bektas @ 2021-05-04 13:10 UTC (permalink / raw)
  To: pbs-devel

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@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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-06  6:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-06  6:24 [pbs-devel] [PATCH backup] tape: create drive-state and changer-state directories with correct permissions Dietmar Maurer
  -- strict thread matches above, loose matches on Subject: below --
2021-05-04 13:10 Oguz Bektas

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal