From f903a3dcc80c4bad08dab1474b76c461c7f668a1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 17 Aug 2012 11:01:07 -0400 Subject: [PATCH] dhcpcd.nix: Add a reload action for rebinding interfaces --- modules/services/networking/dhcpcd.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/services/networking/dhcpcd.nix b/modules/services/networking/dhcpcd.nix index 2767af7200e..54fdf7b81cf 100644 --- a/modules/services/networking/dhcpcd.nix +++ b/modules/services/networking/dhcpcd.nix @@ -62,7 +62,7 @@ let fi #if [ "$reason" = EXPIRE -o "$reason" = RELEASE -o "$reason" = NOCARRIER ] ; then - # ${config.system.build.upstart}/sbin/initctl emit -n ip-down $params + # ${config.system.build.systemd}/bin/systemctl start ip-down.target #fi ''; @@ -102,6 +102,11 @@ in daemonType = "fork"; exec = "dhcpcd --config ${dhcpcdConf}"; + + serviceConfig = + '' + ExecReload=${dhcpcd}/sbin/dhcpcd --rebind + ''; }; environment.systemPackages = [ dhcpcd ]; @@ -115,8 +120,7 @@ in powerManagement.resumeCommands = '' # Tell dhcpcd to rebind its interfaces if it's running. - status="$(${config.system.build.upstart}/sbin/status dhcpcd)" - [[ "$status" =~ start/running ]] && ${dhcpcd}/sbin/dhcpcd --rebind + ${config.system.build.systemctl}/bin/systemctl reload dhcpcd.service ''; };