diff --git a/etc/systemd/system-generators/zfs-mount-generator.in b/etc/systemd/system-generators/zfs-mount-generator.in index 1971805337..f7a5161ec3 100755 --- a/etc/systemd/system-generators/zfs-mount-generator.in +++ b/etc/systemd/system-generators/zfs-mount-generator.in @@ -115,6 +115,7 @@ process_line() { wants="zfs-import.target" requires="" requiredmounts="" + bindsto="" wantedby="" requiredby="" noauto="off" @@ -202,7 +203,8 @@ ExecStop=@sbindir@/zfs unload-key '${dataset}'" > "${dest_norm}/${keyloadunit} fi # Update the dependencies for the mount file to want the # key-loading unit. - wants="${wants} ${keyloadunit}" + wants="${wants}" + bindsto="BindsTo=${keyloadunit}" after="${after} ${keyloadunit}" fi @@ -413,6 +415,7 @@ Documentation=man:zfs-mount-generator(8) Before=${before} After=${after} Wants=${wants} +${bindsto} ${requires} ${requiredmounts}