1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

dnsmasq.postconf not running

Discussion in 'Asuswrt-Merlin' started by RichS, Apr 21, 2019.

  1. RichS

    RichS New Around Here

    Joined:
    Apr 21, 2019
    Messages:
    2
    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:
    [email protected]:/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:
    [email protected]:/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.
     
  2. dave14305

    dave14305 Very Senior Member

    Joined:
    May 19, 2018
    Messages:
    604
    Is Entware loaded before dnsmasq starts? Maybe /opt/bin/find isn’t available to use yet.
     
    Last edited: Apr 21, 2019
  3. RichS

    RichS New Around Here

    Joined:
    Apr 21, 2019
    Messages:
    2
    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
     
    amplatfus and dave14305 like this.