Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dnsmasq cant load config folder in new openwrt release #10625

Closed
rezad1393 opened this issue Sep 6, 2022 · 10 comments
Closed

dnsmasq cant load config folder in new openwrt release #10625

rezad1393 opened this issue Sep 6, 2022 · 10 comments

Comments

@rezad1393
Copy link

I upgraded to 22.03 today and got this error:
daemon.crit dnsmasq[1]: cannot access directory /etc/dnsmasq.d: No such file or directory
I have checked and folder is there.

@jow-
Copy link
Contributor

jow- commented Sep 6, 2022

Please provide your /etc/config/dhcp and /etc/dnsmasq.conf

@rezad1393
Copy link
Author

rezad1393 commented Sep 6, 2022

config dnsmasq
        option domainneeded '1'
        option localise_queries '1'
        option local '/lan/'
        option domain 'lan'
        option expandhosts '1'
        option authoritative '1'
        option readethers '1'
        option leasefile '/tmp/dhcp.leases'
        option localservice '1'
        option ednspacket_max '1232'
        option confdir '/tmp/dnsmasq.d'
        option cachesize '1000'
        #list server '/.ir/8.8.8.8'
        list server '/.pool.ntp.org/8.8.8.8'
        #list server '8.8.8.8'
        list server '192.168.1.20#253'
        option rebind_protection '1'

config dhcp 'lan'
        option interface 'lan'
        option start '100'
        option limit '150'
        option leasetime '12h'
        list ra_flags 'none'

config dhcp 'wan'
        option interface 'wan'
        option ignore '1'
        list ra_flags 'none'

quiet-dhcp
strict-order
log-facility=syslog
min-cache-ttl=3600
all-servers

# For debugging purposes, log each DNS query as it passes through
# dnsmasq.
#log-queries

# Log lots of extra information about DHCP transactions.
#log-dhcp

# Include another lot of configuration options.
#conf-file=/etc/dnsmasq.more.conf
#conf-dir=/etc/dnsmasq.d

# Include all the files in a directory except those ending in .bak
#conf-dir=/etc/dnsmasq.d,.bak

# Include all files in a directory which end in .conf
#conf-dir=/etc/dnsmasq.d/,*.conf

I had to "#conf-dir=/etc/dnsmasq.d/,*.conf" comment it out for now for it to not crash.

@stintel
Copy link
Member

stintel commented Sep 6, 2022

option confdir '/tmp/dnsmasq.d,/etc/dnsmasq.d' ?

@rezad1393
Copy link
Author

rezad1393 commented Sep 6, 2022

??

option confdir '/tmp/dnsmasq.d,/etc/dnsmasq.d' ?

??

oh
i saw it now. let me check that.

@rezad1393
Copy link
Author

weird.
I just upgraded and it didnt work with new software so I I thought my config was fine.
I dont even remember why that line is there.
thank you.

@rezad1393 rezad1393 reopened this Sep 6, 2022
@rezad1393
Copy link
Author

too soon.
I forgot to uncommment the dnsmasq.conf line before restart.
the bug is still there.

@stintel
Copy link
Member

stintel commented Sep 6, 2022

Remove it from /etc/dnsmasq.conf and add it in /etc/config/dhcp as in my previous comment. If that doesn't work maybe we should change the UCI option to a list and loop over it, adding multiple --conf-dir arguments.

@rezad1393
Copy link
Author

I replaced option confdir '/tmp/dnsmasq.d' with option confdir '/etc/dnsmasq.d' and it works now.
is this a bug that I just am ignoring?
why did I have to change this from one version of openwrt to another?

@stintel
Copy link
Member

stintel commented Sep 6, 2022

I'd rather call it a feature. Dnsmasq is running in ujail now. The init script will make sure the path in the UCI option is exposed in the jail, but we don't parse /etc/dnsmasq.conf to do that.

@rezad1393
Copy link
Author

I'd rather call it a feature. Dnsmasq is running in ujail now. The init script will make sure the path in the UCI option is exposed in the jail, but we don't parse /etc/dnsmasq.conf to do that.

I was gonna suggest that it may have to do with jail but I didnt see anything in changelog of openwrt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants