From acd2a1f57f964961e810897c7f2d6af99a2bb57e Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 7 May 2018 14:57:34 +0200 Subject: [PATCH] Fix dhcpcd service First of all, fix the dependency name in the per-interface service file. Second, we allow the master services daemonize itself and change the target to wait. This way, we block init until we are sure the dhcpcd master is running. Otherwise we have a race condition if init gets scheduled for some reason and immediately starts the dhcpcd interface daemon that cannot see the master and decides that *it* is the msater now. Signed-off-by: David Oberhollenzer --- pkg/init/share/init/dhcpcd | 2 +- pkg/init/share/init/dhcpcdmaster | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/init/share/init/dhcpcd b/pkg/init/share/init/dhcpcd index ad96c77..c08fac0 100644 --- a/pkg/init/share/init/dhcpcd +++ b/pkg/init/share/init/dhcpcd @@ -1,6 +1,6 @@ description "DHCP client on %0" type once target boot -after dhcpcd +after dhcpcdmaster exec dhcpcd -n %0 diff --git a/pkg/init/share/init/dhcpcdmaster b/pkg/init/share/init/dhcpcdmaster index 39481f4..6d0fecd 100644 --- a/pkg/init/share/init/dhcpcdmaster +++ b/pkg/init/share/init/dhcpcdmaster @@ -1,9 +1,9 @@ description "DHCP client - master service" -type respawn limit 5 +type wait target boot after sysinit ifrename ifcfg exec { mkdir -p /var/db/dhcpcd - dhcpcd -B --inactive + dhcpcd --inactive }