Comment 10 for bug 1741081

Revision history for this message
Scott Emmons (lscotte) wrote :

OK, I retested with 0.7.5-1ubuntu3 and it's almost there but zfs-mount.service still runs before the zfs kernel module is loaded:

$ systemctl --failed
  UNIT LOAD ACTIVE SUB DESCRIPTION
● zfs-mount.service loaded failed failed Mount ZFS filesystems

$ sudo journalctl -u zfs-mount.service
-- Logs begin at Fri 2018-03-02 19:08:55 UTC, end at Fri 2018-03-02 19:31:42 UTC. --
Mar 02 19:09:00 ubuntu systemd[1]: Starting Mount ZFS filesystems...
Mar 02 19:09:00 ubuntu zfs[557]: The ZFS modules are not loaded.
Mar 02 19:09:00 ubuntu zfs[557]: Try running '/sbin/modprobe zfs' as root to load them.
Mar 02 19:09:00 ubuntu systemd[1]: zfs-mount.service: Main process exited, code=exited, status=1/FAILURE
Mar 02 19:09:00 ubuntu systemd[1]: zfs-mount.service: Failed with result 'exit-code'.
Mar 02 19:09:00 ubuntu systemd[1]: Failed to start Mount ZFS filesystems.

But, by the time the system is fully up, something else has loaded the zfs kernel module along the way:

$ lsmod|grep zfs
zfs 3407872 3

I do see that zfs-load-module.service has "WantedBy=zfs-mount.service", but maybe zfs-mount.service needs "After=zfs-load-module.service" to insure the dependency order? Looking at the dependency tree, zfs-mount.service and zfs-import.target happen in parallel with the start of zfs-load-module.service resulting in a race condition.