check for service exsitance before enabling zfs-import service
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
@ -394,10 +394,12 @@ __PACKAGE__->register_method ({
|
|||||||
print "# ", join(' ', @$cmd), "\n";
|
print "# ", join(' ', @$cmd), "\n";
|
||||||
run_command($cmd);
|
run_command($cmd);
|
||||||
|
|
||||||
my $importunit = 'zfs-import@'. PVE::Systemd::escape_unit($name, undef) . '.service';
|
if (-e '/lib/systemd/system/zfs-import@.service') {
|
||||||
$cmd = ['systemctl', 'enable', $importunit];
|
my $importunit = 'zfs-import@'. PVE::Systemd::escape_unit($name, undef) . '.service';
|
||||||
print "# ", join(' ', @$cmd), "\n";
|
$cmd = ['systemctl', 'enable', $importunit];
|
||||||
run_command($cmd);
|
print "# ", join(' ', @$cmd), "\n";
|
||||||
|
run_command($cmd);
|
||||||
|
}
|
||||||
|
|
||||||
if ($param->{add_storage}) {
|
if ($param->{add_storage}) {
|
||||||
my $storage_params = {
|
my $storage_params = {
|
||||||
|
|||||||
Reference in New Issue
Block a user