What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

dnsmasq.conf.add not being read before running dnsmasq

GlowingApple

New Around Here
I'm having issues getting dnsmasq.conf.add to work. I added a "addn-hosts" line. I have the file in /jffs, and I see that the addn-hosts line is added to end of the /etc/dnsmasq.conf file, but dnsmasq isn't reading those hosts.

If I restart dnsmasq it then reads in those hosts. It seems like the router is loading up dnsmasq before it adds the dnsmasq.conf.add lines.
 
I'm having issues getting dnsmasq.conf.add to work. I added a "addn-hosts" line. I have the file in /jffs, and I see that the addn-hosts line is added to end of the /etc/dnsmasq.conf file, but dnsmasq isn't reading those hosts.

If I restart dnsmasq it then reads in those hosts. It seems like the router is loading up dnsmasq before it adds the dnsmasq.conf.add lines.

I just re-checked, and dnsmasq definitely gets run only after the dnsmasq.conf is completely generated, with all postconf and additions processed. Your issue lies elsewhere.

BTW, it should be in /jffs/configs/ not in /jffs .
 
I just re-checked, and dnsmasq definitely gets run only after the dnsmasq.conf is completely generated, with all postconf and additions processed. Your issue lies elsewhere.

BTW, it should be in /jffs/configs/ not in /jffs .

Oops, yes the file is in /jffs/configs, just typed the path wrong here!

Any suggestions on where else to look for this issue? I've also noticed some services installed in /tmp/opt (on a USB3 flash drive) are not being started on boot, but running them manually after boot works just fine. I'm not sure if these issues are related or not though.

EDIT: The addn-hosts line is pointing to a file in /opt/etc, so maybe the flash drive isn't being mounted (or isn't finished mounting) before dnsmasq is started?
 
EDIT: The addn-hosts line is pointing to a file in /opt/etc, so maybe the flash drive isn't being mounted (or isn't finished mounting) before dnsmasq is started?

That'd be the most likely reason. USB disks get mounted quite late during boot, so dnsmasq is most likely already running before that. You should move that to the JFFS partition instead, which gets mounted very early.
 
Moved the file to the jffs partition and it's working well! Thanks for the info! (and also thanks for the great firmware!)

I added some logging (using logger) to the scripts and it seems services-start is running well before post-mount.

That would also explain why the services I installed (with opkg) aren't running. I found a thread (http://www.snbforums.com/threads/help-with-services-start.24428/#post-182565) that suggests adding "/opt/etc/init.d/rc.unslung restart" to the post-mount script, which hopefully should get my other services starting on boot.
 
Moved the file to the jffs partition and it's working well! Thanks for the info! (and also thanks for the great firmware!)

I added some logging (using logger) to the scripts and it seems services-start is running well before post-mount.

That would also explain why the services I installed (with opkg) aren't running. I found a thread (http://www.snbforums.com/threads/help-with-services-start.24428/#post-182565) that suggests adding "/opt/etc/init.d/rc.unslung restart" to the post-mount script, which hopefully should get my other services starting on boot.

USB disks get mounted near the end of services-start. services-start starts with the basic networking services, the LAN, the WAN, and ends with the more application-centric services such as mount USB disks.
 

Similar threads

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Back
Top