Skip to contentSkip to conversation

dhcpcd: add --dbdir and --disable-privesp to EXTRA_OECONF

PATCH In review Yi Zhao 3 participants 3 messages Sep 15, 2020 – Sep 18, 2020

lore
Share & tools
lore

Yi Zhao

author
#0 lore raw

PATCH 1/1 dhcpcd: add --dbdir and --disable-privesp to EXTRA_OECONF

* Disable service start at boot time. This may conflict with connman.
* Set --dbdir to /var/lib/dhcpcd rather than /var/db/dhcpcd to satisfy FHS compliance.
* Pass --disable-privsep to configure to eliminate dhcpcd start warning:
no such user dhcpcd.

---
 meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb +2 -1
index 292cb5b008..4b5f4d7766 100644
@@ -22,13 +22,14 @@ SRC_URI[sha256sum] = "fcb2d19672d445bbfd38678fdee4f556ef967a3ea6bd81092d10545df2
 inherit pkgconfig autotools-brokensep systemd
 
 SYSTEMD_SERVICE_${PN} = "dhcpcd.service"
+SYSTEMD_AUTO_ENABLE_${PN} = "disable"
 
 PACKAGECONFIG ?= "udev ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 
 PACKAGECONFIG[udev] = "--with-udev,--without-udev,udev,udev"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6"
 
-EXTRA_OECONF = "--enable-ipv4"
+EXTRA_OECONF = "--enable-ipv4 --disable-privsep --dbdir=${localstatedir}/lib/${BPN}"
 
 do_install_append () {
     # install systemd unit files
Signature · 1 line
2.17.1
#1 lore raw
Quoted 6 lines · Yi Zhao

* Disable service start at boot time. This may conflict with connman.
* Set --dbdir to /var/lib/dhcpcd rather than /var/db/dhcpcd to satisfy FHS compliance.
* Pass --disable-privsep to configure to eliminate dhcpcd start warning:
no such user dhcpcd.

Isn't it better to just create the missing user at the system level?

You could leverage systemd sysusers.d as done by arch at
https://github.com/archlinux/svntogit-packages/blob/packages/dhcpcd/trunk/dhcpcd.sysusers
(in case systemd is enabled).

Quoted 26 lines
---
 meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-connectivity/dhcpcd/dhcpcd_9.2.0.bb +2 -2
index 292cb5b008..4b5f4d7766 100644
@@ -22,13 +22,14 @@ SRC_URI[sha256sum] = "fcb2d19672d445bbfd38678fdee4f556ef967a3ea6bd81092d10545df2
 inherit pkgconfig autotools-brokensep systemd
 
 SYSTEMD_SERVICE_${PN} = "dhcpcd.service"
+SYSTEMD_AUTO_ENABLE_${PN} = "disable"
 
 PACKAGECONFIG ?= "udev ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
 
 PACKAGECONFIG[udev] = "--with-udev,--without-udev,udev,udev"
 PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6"
 
-EXTRA_OECONF = "--enable-ipv4"
+EXTRA_OECONF = "--enable-ipv4 --disable-privsep --dbdir=${localstatedir}/lib/${BPN}"
 
 do_install_append () {
     # install systemd unit files
--
Quoted 3 lines

2.17.1

Cheers,

Signature · 1 line
Ricardo Salveti
#2 lore raw
In reply to Yi Zhao
Quoted 1 line · Yi Zhao

* Disable service start at boot time. This may conflict with connman.

Maybe we should just stop people installing multiple DHCP clients at the same time.

Quoted 2 lines

* Pass --disable-privsep to configure to eliminate dhcpcd start warning:
no such user dhcpcd.

Create the user instead please.

Ross