Merge pull request #227208 from ElvishJerricco/zfs-systemd-target-ordering
zfs: Relate import services to zfs-import.target instead of local-fs
This commit is contained in:
@@ -119,8 +119,8 @@ let
|
|||||||
"systemd-modules-load.service"
|
"systemd-modules-load.service"
|
||||||
"systemd-ask-password-console.service"
|
"systemd-ask-password-console.service"
|
||||||
];
|
];
|
||||||
wantedBy = (getPoolMounts prefix pool) ++ [ "local-fs.target" ];
|
requiredBy = getPoolMounts prefix pool ++ [ "zfs-import.target" ];
|
||||||
before = (getPoolMounts prefix pool) ++ [ "local-fs.target" ];
|
before = getPoolMounts prefix pool ++ [ "zfs-import.target" ];
|
||||||
unitConfig = {
|
unitConfig = {
|
||||||
DefaultDependencies = "no";
|
DefaultDependencies = "no";
|
||||||
};
|
};
|
||||||
@@ -628,6 +628,8 @@ in
|
|||||||
force = cfgZfs.forceImportRoot;
|
force = cfgZfs.forceImportRoot;
|
||||||
prefix = "/sysroot";
|
prefix = "/sysroot";
|
||||||
}) rootPools);
|
}) rootPools);
|
||||||
|
targets.zfs-import.wantedBy = [ "zfs.target" ];
|
||||||
|
targets.zfs.wantedBy = [ "initrd.target" ];
|
||||||
extraBin = {
|
extraBin = {
|
||||||
# zpool and zfs are already in thanks to fsPackages
|
# zpool and zfs are already in thanks to fsPackages
|
||||||
awk = "${pkgs.gawk}/bin/awk";
|
awk = "${pkgs.gawk}/bin/awk";
|
||||||
@@ -739,15 +741,7 @@ in
|
|||||||
map createSyncService allPools ++
|
map createSyncService allPools ++
|
||||||
map createZfsService [ "zfs-mount" "zfs-share" "zfs-zed" ]);
|
map createZfsService [ "zfs-mount" "zfs-share" "zfs-zed" ]);
|
||||||
|
|
||||||
systemd.targets.zfs-import =
|
systemd.targets.zfs-import.wantedBy = [ "zfs.target" ];
|
||||||
let
|
|
||||||
services = map (pool: "zfs-import-${pool}.service") dataPools;
|
|
||||||
in
|
|
||||||
{
|
|
||||||
requires = services;
|
|
||||||
after = services;
|
|
||||||
wantedBy = [ "zfs.target" ];
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.targets.zfs.wantedBy = [ "multi-user.target" ];
|
systemd.targets.zfs.wantedBy = [ "multi-user.target" ];
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user