nixos/dhcpcd: Only run resume commands if enabled.

The networkd implementation sets systemd.services.dhcpcd.enable to
false in nixos/modules/tasks/network-interfaces-systemd.nix. So we need
to respect that in the dhcpcd module.

If we don't, the resumeCommand is set nevertheless, which causes the
post-resume.service to fail after resuming:

Failed to reload dhcpcd.service: Unit dhcpcd.service is masked.
post-resume.service: main process exited, code=exited, status=1/FAILURE
Failed to start Post-Resume Actions.
Dependency failed for Post-Resume Actions.
Unit post-resume.service entered failed state.
post-resume.service failed.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2015-02-22 08:09:04 +01:00
parent 0696b0ef78
commit 030895f075
No known key found for this signature in database
GPG Key ID: D0EBD0EC8C2DC961

View File

@ -184,7 +184,7 @@ in
} }
]; ];
powerManagement.resumeCommands = powerManagement.resumeCommands = mkIf config.systemd.services.dhcpcd.enable
'' ''
# Tell dhcpcd to rebind its interfaces if it's running. # Tell dhcpcd to rebind its interfaces if it's running.
${config.systemd.package}/bin/systemctl reload dhcpcd.service ${config.systemd.package}/bin/systemctl reload dhcpcd.service