Subject: [PATCH] main/dhcpcd: fix rundir and pidfile

From: opal hart <[email-masked]>
Date: Tue, 14 Dec 2021 12:29:28 +0000

dhcpcd does not write a pidfile to /run/dhcpcd.pid; this may have been
true in the past, but now it directly writes files (pid, sock, ...) to
the configured rundir. Configure with --rundir=/run/dhcpcd as Gentoo
ebuild for net-misc/dhcpcd does, and direct the initscript to
/run/dhcpcd/pid for pidfile.
---
 main/dhcpcd/APKBUILD     | 4 ++--
 main/dhcpcd/dhcpcd.initd | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/main/dhcpcd/APKBUILD b/main/dhcpcd/APKBUILD
index 269a068ca9..3a7d18d1b1 100644
--- a/main/dhcpcd/APKBUILD
+++ b/main/dhcpcd/APKBUILD
@@ -3,7 +3,7 @@
 # Maintainer: Natanael Copa <[email-masked]>
 pkgname=dhcpcd
 pkgver=9.4.1
-pkgrel=0
+pkgrel=1
 pkgdesc="RFC2131 compliant DHCP client"
 url="https://roy.marples.name/projects/dhcpcd"
 arch="all"
@@ -26,7 +26,7 @@ build() {
 		--localstatedir=/var \
 		--libexecdir=/usr/lib/$pkgname \
 		--dbdir=/var/lib/$pkgname \
-		--rundir=/run \
+		--rundir=/run/dhcpcd \
 		--enable-ipv6 \
 		--without-dev \
 		--without-udev
diff --git a/main/dhcpcd/dhcpcd.initd b/main/dhcpcd/dhcpcd.initd
index aab118242e..217d03ee21 100644
--- a/main/dhcpcd/dhcpcd.initd
+++ b/main/dhcpcd/dhcpcd.initd
@@ -5,7 +5,7 @@ description="DHCP Client Daemon"
 command="/sbin/dhcpcd"
 command_args="-q ${command_args:-}"
 command_args_foreground="-B"
-pidfile="/run/dhcpcd.pid"
+pidfile="/run/dhcpcd/pid"
 
 depend() {
 	provide net
-- 
2.32.0