dnsmasq: fix remove pidfile on shutdown regression
authorKevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
Mon, 5 Sep 2016 08:01:19 +0000 (09:01 +0100)
committerFelix Fietkau <nbd@nbd.name>
Tue, 6 Sep 2016 09:26:05 +0000 (11:26 +0200)
Regression introduced by 3481d0d dnsmasq: run as dedicated UID/GID

dnsmasq is unable to remove its own pidfile as /var/run/dnsmasq is owned
by root and now dnsmasq runs as dnsmasq:dnsmasq.  Change directory
ownership to match.

dnsmasq initially starts as root, creates the pidfile, then drops to
requested non-root user.  Until this fix dnsmasq had insufficient
privilege to remove its own pidfile.

Signed-off-by: Kevin Darbyshire-Bryant <kevin@darbyshire-bryant.me.uk>
package/network/services/dnsmasq/files/dnsmasq.init

index 2b81a61bcc17c63fc5a86204c22b630babb20ed2..4cd5f673d8b5f1ce9d97241dd01d2e074b62a6f1 100644 (file)
@@ -643,6 +643,7 @@ start_service() {
        mkdir -p $(dirname $CONFIGFILE)
        mkdir -p /var/lib/misc
        touch /tmp/dhcp.leases
+       chown dnsmasq:dnsmasq /var/run/dnsmasq
 
        [ -f "$TIMESTAMPFILE" ] && rm -f "$TIMESTAMPFILE"