0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 13:40:28 +03:00

Merge pull request #271326 from philiptaron/shutdown.target

treewide: depend on `shutdown.target` if `DefaultDependencies=no` in almost every case
This commit is contained in:
nikstur 2023-12-27 08:33:26 +01:00 committed by GitHub
commit c9569af3e0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 43 additions and 18 deletions

View file

@ -406,7 +406,8 @@ in
ConditionVirtualization = "!container";
DefaultDependencies = false; # needed to prevent a cycle
};
before = [ "systemd-pstore.service" ];
before = [ "systemd-pstore.service" "shutdown.target" ];
conflicts = [ "shutdown.target" ];
wantedBy = [ "systemd-pstore.service" ];
};
};

View file

@ -78,9 +78,10 @@ let
value = {
description = "Unlock bcachefs for ${fs.mountPoint}";
requiredBy = [ mountUnit ];
before = [ mountUnit ];
bindsTo = [ deviceUnit ];
after = [ deviceUnit ];
before = [ mountUnit "shutdown.target" ];
bindsTo = [ deviceUnit ];
conflicts = [ "shutdown.target" ];
unitConfig.DefaultDependencies = false;
serviceConfig = {
Type = "oneshot";

View file

@ -130,7 +130,8 @@ let
"systemd-ask-password-console.service"
] ++ optional (config.boot.initrd.clevis.useTang) "network-online.target";
requiredBy = getPoolMounts prefix pool ++ [ "zfs-import.target" ];
before = getPoolMounts prefix pool ++ [ "zfs-import.target" ];
before = getPoolMounts prefix pool ++ [ "shutdown.target" "zfs-import.target" ];
conflicts = [ "shutdown.target" ];
unitConfig = {
DefaultDependencies = "no";
};

View file

@ -1410,9 +1410,11 @@ in
systemd.services.domainname = lib.mkIf (cfg.domain != null) {
wantedBy = [ "sysinit.target" ];
before = [ "sysinit.target" ];
before = [ "sysinit.target" "shutdown.target" ];
conflicts = [ "shutdown.target" ];
unitConfig.DefaultDependencies = false;
serviceConfig.ExecStart = ''${pkgs.nettools}/bin/domainname "${cfg.domain}"'';
serviceConfig.Type = "oneshot";
};
environment.etc.hostid = mkIf (cfg.hostId != null) { source = hostidFile; };