odhcpd: create /tmp/odhcpd in the init script

odhcpd creates its default lease directory /tmp/odhcpd/leases itself,
which only works while it runs as root.

Create /tmp/odhcpd in the init script, owned by root and with fixed
permissions, so that it only needs to be handed over to the odhcpd user
once odhcpd runs unprivileged (#24558).

Signed-off-by: David Härdeman <david@hardeman.nu>
Link: https://github.com/openwrt/openwrt/pull/27183
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
David Härdeman authored and Robert Marko committed 2026-12-05 15:36:36 +01:00
1 parent 9b6ef8e510
commit ea42d87528
1 file changed
+4
@@ -5,6 +5,10 @@ STOP=85
USE_PROCD=1
start_service() {
mkdir -p /tmp/odhcpd
find /tmp/odhcpd -type d -exec chmod 0755 {} \;
# chown -R odhcpd:odhcpd /tmp/odhcpd
procd_open_instance
procd_set_param command /usr/sbin/odhcpd
procd_set_param respawn