From e2ecf5b808c565cd618486f8fa097a9c79f97528 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 27 Nov 2013 19:00:14 -0600 Subject: [PATCH] dhcp: dhcpcd uses a fixed path for PID files It always uses RUNDIR and the change to NMRUNDIR was in error. This could cause NetworkManager not to be able to kill old dhcpcd processes. --- src/Makefile.am | 1 + src/dhcp-manager/nm-dhcp-dhcpcd.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Makefile.am b/src/Makefile.am index 34b733980..1e4ad7085 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -368,6 +368,7 @@ AM_CPPFLAGS += \ -DLOCALSTATEDIR=\"$(localstatedir)\" \ -DSBINDIR=\"$(sbindir)\" \ -DSYSCONFDIR=\"$(sysconfdir)\" \ + -DRUNDIR=\"$(rundir)\" \ \ -DNMCONFDIR=\"$(nmconfdir)\" \ -DNMLOCALEDIR=\"$(datadir)/locale\" \ diff --git a/src/dhcp-manager/nm-dhcp-dhcpcd.c b/src/dhcp-manager/nm-dhcp-dhcpcd.c index 6cb721cab..a62e315f7 100644 --- a/src/dhcp-manager/nm-dhcp-dhcpcd.c +++ b/src/dhcp-manager/nm-dhcp-dhcpcd.c @@ -103,7 +103,10 @@ ip4_start (NMDHCPClient *client, iface = nm_dhcp_client_get_iface (client); - priv->pid_file = g_strdup_printf (NMSTATEDIR "/dhcpcd-%s.pid", iface); + /* dhcpcd does not allow custom pidfiles; the pidfile is always + * RUNDIR "dhcpcd-.pid". + */ + priv->pid_file = g_strdup_printf (RUNDIR "/dhcpcd-%s.pid", iface); if (!g_file_test (priv->path, G_FILE_TEST_EXISTS)) { nm_log_warn (LOGD_DHCP4, "%s does not exist.", priv->path);