[pve-devel] applied: [pbs-devel] [RFC proxmox-backup 1/1] api2/node/disks/zfs: instantiate import service

Thomas Lamprecht t.lamprecht at proxmox.com
Wed Sep 30 09:35:45 CEST 2020


On 16.09.20 14:14, Stoiko Ivanov wrote:
> When creating a new zpool for a datastore, also instantiate an
> import-unit for it. This helps in cases where '/etc/zfs/zool.cache'
> get corrupted and thus the pool is not imported upon boot.
> 
> This patch needs the corresponding addition of 'zfs-import at .service' in
> the zfsonlinux repository.
> 
> Suggested-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
> Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
> ---
>  src/api2/node/disks/zfs.rs | 5 +++++
>  1 file changed, 5 insertions(+)
> 
>

applied, thanks!

did the following (-w white-space ignored) change, similar to the PVE one.

diff --git a/src/api2/node/disks/zfs.rs b/src/api2/node/disks/zfs.rs
index 0f0e4220..16534199 100644
--- a/src/api2/node/disks/zfs.rs
+++ b/src/api2/node/disks/zfs.rs
@@ -357,8 +357,10 @@ pub fn create_zpool(
             let output = crate::tools::run_command(command, None)?;
             worker.log(output);
 
+            if std::path::Path::new("/lib/systemd/system/zfs-import at .service").exists() {
                 let import_unit = format!("zfs-import@{}.service", systemd::escape_unit(&name, false));
                 systemd::enable_unit(&import_unit)?;
+            }
 
             if let Some(compression) = compression {
                 let mut command = std::process::Command::new("zfs");





More information about the pve-devel mailing list