public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dietmar Maurer <dietmar@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	 Oguz Bektas <o.bektas@proxmox.com>
Subject: Re: [pbs-devel] [PATCH backup] tape: create drive-state and changer-state directories with correct permissions
Date: Thu, 6 May 2021 08:24:34 +0200 (CEST)	[thread overview]
Message-ID: <908022960.193.1620282274258@webmail.proxmox.com> (raw)

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




             reply	other threads:[~2021-05-06  6:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-06  6:24 Dietmar Maurer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-05-04 13:10 Oguz Bektas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=908022960.193.1620282274258@webmail.proxmox.com \
    --to=dietmar@proxmox.com \
    --cc=o.bektas@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal