What's new

dnsmasq.postconf not running

  • 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!

RichS

New Around Here
I've been trying to figure out why my dnsmasq.postconf script isn't running when the router boots up. I'm currently running an Asus RT-AC68u with Asuswrt-Merlin 384.10_2.

Afaik, the permissions are correct:
admin@crouter:/tmp/home/root# ls -l /jffs/scripts/dnsmasq.postconf
-rwxr-xr-x 1 admin root 130 Apr 20 02:08 /jffs/scripts/dnsmasq.postconf


I've tried adding some logger calls, but they don't show up in syslog. Here's the current source:
admin@crouter:/jffs/scripts# cat dnsmasq.postconf
#!/bin/sh
CONFIG=$1
logger dnsmasq.postconf
for script in $(/opt/bin/find /jffs/scripts/dnsmasq-postconf.d/ -type f); do
logger Run $script
source $script $CONFIG
done


The strangest thing is that the script IS executing when I do a service restart_dnsmasq, just not when the router boots. Any hints or debugging tips would be greatly appreciated.
 
I've been trying to figure out why my dnsmasq.postconf script isn't running when the router boots up. I'm currently running an Asus RT-AC68u with Asuswrt-Merlin 384.10_2.

Afaik, the permissions are correct:
admin@crouter:/tmp/home/root# ls -l /jffs/scripts/dnsmasq.postconf
-rwxr-xr-x 1 admin root 130 Apr 20 02:08 /jffs/scripts/dnsmasq.postconf


I've tried adding some logger calls, but they don't show up in syslog. Here's the current source:
admin@crouter:/jffs/scripts# cat dnsmasq.postconf
#!/bin/sh
CONFIG=$1
logger dnsmasq.postconf
for script in $(/opt/bin/find /jffs/scripts/dnsmasq-postconf.d/ -type f); do
logger Run $script
source $script $CONFIG
done


The strangest thing is that the script IS executing when I do a service restart_dnsmasq, just not when the router boots. Any hints or debugging tips would be greatly appreciated.
Is Entware loaded before dnsmasq starts? Maybe /opt/bin/find isn’t available to use yet.
 
Last edited:
That was it! Thank you for the tip.

I opted for GNU find because the Busybox version doesn't support -type and shell globbing wouldn't work correctly if nothing was matched. Final solution:
for script in /jffs/scripts/dnsmasq-postconf.d/*; do
if [ -f $script ]; then
source $script $CONFIG
fi
done
 

Latest threads

Sign Up For SNBForums Daily Digest

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