From deb7c6d35bffd569e137be72312089ad7515f2c4 Mon Sep 17 00:00:00 2001 From: Jack Cummings Date: Fri, 7 Jun 2013 09:34:46 -0700 Subject: [PATCH] don't try to re-import pools on service change When nixos-rebuild grabs a new kernel, it will build new spl/zfs modules, which will change the service. On completion nixos will try and restart the services which will try and import pools again, and generally will fail. The pools are already imported, we don't need to do it again.. --- modules/tasks/filesystems/zfs.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/tasks/filesystems/zfs.nix b/modules/tasks/filesystems/zfs.nix index b76c50f420f..7fc84bb2ac8 100644 --- a/modules/tasks/filesystems/zfs.nix +++ b/modules/tasks/filesystems/zfs.nix @@ -69,6 +69,7 @@ in serviceConfig = { Type = "oneshot"; RemainAfterExit = true; + restartIfChanged = false; ExecStart = "${kernel.zfs}/sbin/zpool import -f -a -d /dev"; }; }; @@ -84,8 +85,8 @@ in ExecStop = "${kernel.zfs}/sbin/zfs umount -a"; }; }; - - system.fsPackages = [ kernel.zfs ]; # XXX: needed? zfs doesn't have a fsck + + system.fsPackages = [ kernel.zfs ]; # XXX: needed? zfs doesn't have (need) a fsck environment.systemPackages = [ kernel.zfs ]; services.udev.packages = [ kernel.zfs ]; # to hook zvol naming, etc. };