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

FS#97 - dnsmasq doesn't receive updated dns servers when running inside ujail #5221

Closed
openwrt-bot opened this issue Aug 17, 2016 · 5 comments
Labels

Comments

@openwrt-bot
Copy link

dangowrt:

Bind-mounting /tmp/resolv.conf.auto apparently doesn't forward inotify events arriving from the kernel when resolv.conf.auto was changed (e.g. upstream DNS servers were received by a DHCP client or pppd). Restarting dnsmasq or running it without ujail solves the issue.

@openwrt-bot
Copy link
Author

champtar:

Hi Daniel,
can you check if the inode number of /tmp/resolv.conf.auto change when such events happen
(ls -i /tmp/resolv.conf.auto)

@openwrt-bot
Copy link
Author

dangowrt:

Yes, apparently it does.

root@test:# ls -i /tmp/resolv.conf.auto
3400 /tmp/resolv.conf.auto
root@test:
# /etc/init.d/network restart
root@test:# ls -i /tmp/resolv.conf.auto
3897 /tmp/resolv.conf.auto
root@test:
#

@openwrt-bot
Copy link
Author

champtar:

Hi Daniel,
It's one of the limitations of bind mounts, what you see in the jail is the file with inode 3400 and never the one with inode 3897, because what you really changed is /tmp

There is 2 workarounds:

  1. write to the file instead of replacing it with a new one (with mv/rename). With this option you loose the atomicity of the rename
  2. bind mount the parent dir of the file, bind mouting /tmp is not a good idea but maybe you can move resolv.conf.auto in a dnsmasq dir

@openwrt-bot
Copy link
Author

nwf:

May I propose that netifd write not to /tmp/resolv.conf.auto but to /tmp/netifd/resolv.conf or similar, so that /tmp/netifd can be mounted into the jail as a directory and inotify will work?

@dave14305
Copy link

Fixed by cd48d8d

@jow- jow- closed this as completed May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants