dnsmasq: Add option '--servers-file'
[openwrt.git] / package / network / services / dnsmasq / files / dnsmasq.init
index a0197ef..20333c8 100644 (file)
@@ -128,6 +128,7 @@ dnsmasq() {
        append_bool "$cfg" boguspriv "--bogus-priv"
        append_bool "$cfg" expandhosts "--expand-hosts"
        append_bool "$cfg" enable_tftp "--enable-tftp"
+       append_bool "$cfg" tftp_no_fail "--tftp-no-fail"
        append_bool "$cfg" nonwildcard "--bind-interfaces"
        append_bool "$cfg" fqdn "--dhcp-fqdn"
        append_bool "$cfg" proxydnssec "--proxy-dnssec"
@@ -152,6 +153,7 @@ dnsmasq() {
        config_list_foreach "$cfg" "bogusnxdomain" append_bogusnxdomain
        append_parm "$cfg" "leasefile" "--dhcp-leasefile"
        append_parm "$cfg" "resolvfile" "--resolv-file"
+       append_parm "$cfg" "serversfile" "--servers-file"
        append_parm "$cfg" "tftp_root" "--tftp-root"
        append_parm "$cfg" "dhcp_boot" "--dhcp-boot"
        append_parm "$cfg" "local_ttl" "--local-ttl"
@@ -547,13 +549,22 @@ start_service() {
        config_load dhcp
 
        procd_open_instance
-       procd_set_param command $PROG -C $CONFIGFILE -k
+       procd_set_param command $PROG -C $CONFIGFILE -k -x /var/run/dnsmasq/dnsmasq.pid
        procd_set_param file $CONFIGFILE
        procd_set_param respawn
+
+       procd_add_jail dnsmasq ubus log
+       procd_add_jail_mount $CONFIGFILE $TRUSTANCHORSFILE $HOSTFILE /etc/passwd /dev/urandom /etc/dnsmasq.conf /tmp/dnsmasq.d /tmp/resolv.conf.auto /etc/hosts /etc/ethers
+       procd_add_jail_mount_rw /var/run/dnsmasq/ /tmp/dhcp.leases
+       
        procd_close_instance
 
        # before we can call xappend
+       mkdir -p /var/run/dnsmasq/
        mkdir -p $(dirname $CONFIGFILE)
+       mkdir -p /var/lib/misc
+       touch /tmp/dhcp.leases
+
 
        echo "# auto-generated config file from /etc/config/dhcp" > $CONFIGFILE
        echo "# auto-generated config file from /etc/config/dhcp" > $HOSTFILE