Dnsmasq FAILED to start up

HI
EVERYONE
Unable to start dns problem:
OpenWrt 23.05.2 / dnsmasq-full
Try adding the following row in dnsmasq.conf
conf-dir=/etc/dnsmasq.d/,*.conf
or
conf-file=/etc/test.conf Log display

cannot read /etc/test.conf: No such file or directory
cannot access directory /etc/dnsmasq.d/: No such file or directory
FAILED to start up

Permissions

drwxr-xr-x 2 root root 4096 Dec 26 05:09 /etc/dnsmasq.d/
-rw-r--r-- 1 root root 38 Dec 26 05:18 /etc/test.conf

What could be the reason ?

Maybe start with the contents of the config file?

Just move the content to the extended conf
Put the content back to the main configuration file, Can start normally

Have you added that file to dnsmasq's jail? The main dnsmasq process is run inside a "container" that disallows access to any files or directories not explicitly exposed to the process, so you can't just arbitrarily say "read this file". See addnmount in the configuration options here: https://openwrt.org/docs/guide-user/base-system/dhcp#all_options

2 Likes

might also need to add addtional procd_add_jail lines in /etc/init.d/dnsmasq.

That's exactly what the addnmount option in the config does, adds paths to the jail without having to hack the init file.

didn't know that.

thnx, post changed.

Yeah, no one really knew about it until @dave14305 found it and posted about it here:

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.