summary refs log tree commit diff
path: root/nixos/modules/services/networking/hostapd.nix
diff options
context:
space:
mode:
authorclefru <clemens@endorphin.org>2018-10-17 09:18:52 +0200
committerJoachim Schiele <js@lastlog.de>2018-10-17 09:18:52 +0200
commit725fcdef3f675e96e591377ff9776c72edb13c60 (patch)
treef091f7ddb7b2aa63493842314c0f6750944941cf /nixos/modules/services/networking/hostapd.nix
parentc2c39a29f6e7ea4d7ea2e37c5e3c2595d46ceeea (diff)
downloadnixpkgs-725fcdef3f675e96e591377ff9776c72edb13c60.tar
nixpkgs-725fcdef3f675e96e591377ff9776c72edb13c60.tar.gz
nixpkgs-725fcdef3f675e96e591377ff9776c72edb13c60.tar.bz2
nixpkgs-725fcdef3f675e96e591377ff9776c72edb13c60.tar.lz
nixpkgs-725fcdef3f675e96e591377ff9776c72edb13c60.tar.xz
nixpkgs-725fcdef3f675e96e591377ff9776c72edb13c60.tar.zst
nixpkgs-725fcdef3f675e96e591377ff9776c72edb13c60.zip
Fix hostapd's place in systemd dependency tree. (#45464)
* nat/bind/dhcp.service:
  Remove. Those services have nothing to do with a link-level service.

* sys-subsystem-net-devices-${if}.device:
  Add as BindsTo dependency as this will make hostapd stop when the
  device is unplugged.

* network-link-${if}.service:
  Add hostapd as dependency for this service via requiredBy clause,
  so that the network link is only considered to be established
  only after hostapd has started.

* network.target:
  Remove this from wantedBy clause as this is already implied from
  dependencies stacked above hostapd. And if it's not implied than
  starting hostapd is not required for this particular network
  configuration.
Diffstat (limited to 'nixos/modules/services/networking/hostapd.nix')
-rw-r--r--nixos/modules/services/networking/hostapd.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/nixos/modules/services/networking/hostapd.nix b/nixos/modules/services/networking/hostapd.nix
index 3af0441a89d..9f74e496329 100644
--- a/nixos/modules/services/networking/hostapd.nix
+++ b/nixos/modules/services/networking/hostapd.nix
@@ -157,9 +157,9 @@ in
       { description = "hostapd wireless AP";
 
         path = [ pkgs.hostapd ];
-        wantedBy = [ "network.target" ];
-
-        after = [ "${cfg.interface}-cfg.service" "nat.service" "bind.service" "dhcpd.service" "sys-subsystem-net-devices-${cfg.interface}.device" ];
+        after = [ "sys-subsystem-net-devices-${cfg.interface}.device" ];
+        bindsTo = [ "sys-subsystem-net-devices-${cfg.interface}.device" ];
+        requiredBy = [ "network-link-${cfg.interface}.service" ];
 
         serviceConfig =
           { ExecStart = "${pkgs.hostapd}/bin/hostapd ${configFile}";