api: disks/zfs: check template exsits before enabling zfs-import service
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
905147a5ee
commit
729d41fe6a
|
@ -357,8 +357,10 @@ pub fn create_zpool(
|
||||||
let output = crate::tools::run_command(command, None)?;
|
let output = crate::tools::run_command(command, None)?;
|
||||||
worker.log(output);
|
worker.log(output);
|
||||||
|
|
||||||
let import_unit = format!("zfs-import@{}.service", systemd::escape_unit(&name, false));
|
if std::path::Path::new("/lib/systemd/system/zfs-import@.service").exists() {
|
||||||
systemd::enable_unit(&import_unit)?;
|
let import_unit = format!("zfs-import@{}.service", systemd::escape_unit(&name, false));
|
||||||
|
systemd::enable_unit(&import_unit)?;
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(compression) = compression {
|
if let Some(compression) = compression {
|
||||||
let mut command = std::process::Command::new("zfs");
|
let mut command = std::process::Command::new("zfs");
|
||||||
|
|
Loading…
Reference in New Issue