From 35ebb75cbd1bf5df69313ebfd18c63b03c609edf Mon Sep 17 00:00:00 2001 From: Mike Gilbert Date: Wed, 20 May 2020 21:56:33 -0400 Subject: [PATCH] net-misc/dhcpcd: set rundir=/run/dhcpcd in 9.x Signed-off-by: Mike Gilbert --- ...cpcd-9.0.2.ebuild => dhcpcd-9.0.2-r1.ebuild} | 6 +++--- net-misc/dhcpcd/dhcpcd-9999.ebuild | 6 +++--- net-misc/dhcpcd/files/dhcpcd.initd-r1 | 17 +++++++++++++++++ net-misc/dhcpcd/files/dhcpcd.service-r1 | 15 +++++++++++++++ 4 files changed, 38 insertions(+), 6 deletions(-) rename net-misc/dhcpcd/{dhcpcd-9.0.2.ebuild => dhcpcd-9.0.2-r1.ebuild} (96%) create mode 100644 net-misc/dhcpcd/files/dhcpcd.initd-r1 create mode 100644 net-misc/dhcpcd/files/dhcpcd.service-r1 diff --git a/net-misc/dhcpcd/dhcpcd-9.0.2.ebuild b/net-misc/dhcpcd/dhcpcd-9.0.2-r1.ebuild similarity index 96% rename from net-misc/dhcpcd/dhcpcd-9.0.2.ebuild rename to net-misc/dhcpcd/dhcpcd-9.0.2-r1.ebuild index 9656eabee928..ac18c5907ad8 100644 --- a/net-misc/dhcpcd/dhcpcd-9.0.2.ebuild +++ b/net-misc/dhcpcd/dhcpcd-9.0.2-r1.ebuild @@ -45,7 +45,7 @@ src_configure() { $(use_enable ipv6) $(use_enable privsep) $(usex elibc_glibc '--with-hook=yp.conf' '') - $(usex kernel_linux '--rundir=${EPREFIX}/run' '') + --rundir=$(usex kernel_linux "${EPREFIX}/run/dhcpcd" "${EPREFIX}/var/run/dhcpcd") $(usex privsep '--privsepuser=dhcpcd' '') $(usex udev '' '--without-dev --without-udev') CC="$(tc-getCC)" @@ -56,8 +56,8 @@ src_configure() { src_install() { default keepdir /var/lib/dhcpcd - newinitd "${FILESDIR}"/${PN}.initd ${PN} - systemd_dounit "${FILESDIR}"/${PN}.service + newinitd "${FILESDIR}"/dhcpcd.initd-r1 dhcpcd + systemd_newunit "${FILESDIR}"/dhcpcd.service-r1 dhcpcd.service } pkg_postinst() { diff --git a/net-misc/dhcpcd/dhcpcd-9999.ebuild b/net-misc/dhcpcd/dhcpcd-9999.ebuild index 9656eabee928..ac18c5907ad8 100644 --- a/net-misc/dhcpcd/dhcpcd-9999.ebuild +++ b/net-misc/dhcpcd/dhcpcd-9999.ebuild @@ -45,7 +45,7 @@ src_configure() { $(use_enable ipv6) $(use_enable privsep) $(usex elibc_glibc '--with-hook=yp.conf' '') - $(usex kernel_linux '--rundir=${EPREFIX}/run' '') + --rundir=$(usex kernel_linux "${EPREFIX}/run/dhcpcd" "${EPREFIX}/var/run/dhcpcd") $(usex privsep '--privsepuser=dhcpcd' '') $(usex udev '' '--without-dev --without-udev') CC="$(tc-getCC)" @@ -56,8 +56,8 @@ src_configure() { src_install() { default keepdir /var/lib/dhcpcd - newinitd "${FILESDIR}"/${PN}.initd ${PN} - systemd_dounit "${FILESDIR}"/${PN}.service + newinitd "${FILESDIR}"/dhcpcd.initd-r1 dhcpcd + systemd_newunit "${FILESDIR}"/dhcpcd.service-r1 dhcpcd.service } pkg_postinst() { diff --git a/net-misc/dhcpcd/files/dhcpcd.initd-r1 b/net-misc/dhcpcd/files/dhcpcd.initd-r1 new file mode 100644 index 000000000000..5a872351ab9b --- /dev/null +++ b/net-misc/dhcpcd/files/dhcpcd.initd-r1 @@ -0,0 +1,17 @@ +#!/sbin/openrc-run +# Copyright 2007-2008 Roy Marples +# All rights reserved. Released under the 2-clause BSD license. + +command=${RC_PREFIX}/sbin/dhcpcd +pidfile=${RC_PREFIX}/var/run/dhcpcd/pid +command_args=-q +name="DHCP Client Daemon" + +depend() +{ + provide net + need localmount + use logger network + after bootmisc modules + before dns +} diff --git a/net-misc/dhcpcd/files/dhcpcd.service-r1 b/net-misc/dhcpcd/files/dhcpcd.service-r1 new file mode 100644 index 000000000000..b4309c39b4c3 --- /dev/null +++ b/net-misc/dhcpcd/files/dhcpcd.service-r1 @@ -0,0 +1,15 @@ +[Unit] +Description=Lightweight DHCP client daemon +Wants=network.target +Before=network.target network-online.target + +[Service] +Type=forking +ExecStart=/sbin/dhcpcd -q +PIDFile=/run/dhcpcd/pid +# Avoid duplicate output on stderr/syslog +StandardOutput=null +StandardError=null + +[Install] +WantedBy=multi-user.target -- 2.26.2