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!

Problems with dnsmasq scripts and manual configuration

CornfieldWin

Occasional Visitor
After the policy forbidding system directory names in posted content was explained, here is the intent of the OP:

OK, let's be real clear and specific:

1. dnsmasq.postconf is being repeatedly invoked nine times during reboot. Not maybe. Definitely. As seen in the 9 times by updated dnsmasq.conf.add content. Obviously appending nine times is a bad idea. I have no idea (not big deal in itself!) why. No claim as to the mechanism, only the result. It does not seem compliant with expected behavior as documented by the authoritative Wiki description (ref: user script descriptions) which calls for a single invocation per reboot/service restart. This behavior is 100% repeatable.

2. hosts.postconfs shows in syslog as having been launched (exact entry available) but the script's touch file in jffs does not appear upon reboot and the dynamic system hosts file in etc is not appended at all despite both working when tested in place in the correct jffs location by SSH. This behavior is 100% repeatable.

3. dnsmasq.conf.add as correctly configured manually rather than by script behaves as specified with the contents winding up appended to dnsmasq.conf in the system etc directory. But the addn-hosts dnsmasq directive does not come into effect supplementing the system hosts file. The additional host names added are not resolved. This behavior is 100% repeatable.

Again no claim as to cause or responsibility but simply seeking the fix to get around these problems.
 
Last edited:
Yeah, share that idea part, the directories issue was a surprise and enough said.

OK, let's be real clear and specific:

1. dnsmasq.postconf is being repeatedly invoked nine times during reboot. Not maybe. Definitely. As seen in the 9 times by updated dnsmasq.conf.add content. Obviously appending nine times is a bad idea. I have no idea (not big deal in itself!) why. No claim as to the mechanism, only the result. It does not seem compliant with expected behavior as documented by the authoritative Wiki description (ref: user script descriptions) which calls for a single invocation per reboot/service restart. This behavior is 100% repeatable.

2. hosts.postconfs shows in syslog as having been launched (exact entry available) but the script's touch file in jffs does not appear upon reboot and the dynamic system hosts file in etc is not appended at all despite both working when tested in place in the correct jffs location by SSH. This behavior is 100% repeatable.

3. dnsmasq.conf.add as correctly configured manually rather than by script behaves as specified with the contents winding up appended to dnsmasq.conf in the system etc directory. But the addn-hosts dnsmasq directive does not come into effect supplementing the system host file. The additional host names added are not resolved. This behavior is 100% repeatable.

Again no claim as to cause or responsibility but simply seeking the fix to get around these problems.
 
Perhaps you're not understanding how the dnsmasq custom configs and scripts works when dnsmasq is started.
  1. The firmware deletes /etc/dnsmasq.conf if it exists.
  2. The firmware generates the initial /etc/dnsmasq.conf based on defaults and nvram settings.
  3. /jffs/configs/dnsmasq.conf.add is appended to /etc/dnsmasq.conf
  4. If present, /jffs/configs/dnsmasq.conf overwrites /etc/dnsmasq.conf
  5. /jffs/scripts/dnsmasq.postconf is run, being passed the /etc/dnsmasq.conf path as a parameter for the postconf script to act upon.
There's no opportunity for dnsmasq.postconf to run multiple times on the same file unless your script is poorly written somehow. dnsmasq may restart multiple times during boot as the WAN flaps up and down, or other conditions happen. dnsmasq.conf.add is completely independent from dnsmasq.postconf.

The same sequence happens for hosts as well. Your system log will tell you if the firmware finds any permissions faults with your scripts. But you seem to refuse to post any evidence of your problems, so everyone is left guessing. You're a real pain in the a$$, but who isn't?
 
1. dnsmasq.postconf is being repeatedly invoked nine times during reboot. Not maybe. Definitely. As seen in the 9 times by updated dnsmasq.conf.add content.
Taking you literally, it sounds like you are using dnsmasq.postconf to populate dnsmasq.conf.add. This is not how it's meant to work, if this is indeed what your script does.
 

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