What's new

dnsmasq_restart doesn't clear cache

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

finite9

Regular Contributor
Using Merlin 380.65_2 on AC68U...

I add a site to /jffs/configs/dnsmasq.conf.add to be blacklisted:

address=/idsoftware.com/0.0.0.0

and then

service restart_dnsmasq

but it doesn't clear the cache and I can still ping that address. If I restart the router, then it works and ping within the router correctly goes to 0.0.0.0. If I comment out the line in the conf.add file and restart dnsmasq, it still goes to 0.0.0.0. Either service restart is not clearing the cache, or it's not reading the /jffs/scripts/dnsmasq.conf.add file.

Any suggestions?
 
... it's not reading the /jffs/scripts/dnsmasq.conf.add file.

Indeed it doesn't! ;)

I don't seem to have an issue on my RT-AC68U (although I am on the 380.66 Alpha)

Does adding the following to /jffs/configs/dnsmasq.conf.add
Code:
clear-on-reload

have any impact when restarting dnsmasq?
 
no it doesn't help. This is what my dnsmasq.conf.add looks like:

clear-on-reload
address=/idsoftware.com/0.0.0.0

There's nothing else in it, not even blank lines.
 
no it doesn't help. This is what my dnsmasq.conf.add looks like:

clear-on-reload
address=/idsoftware.com/0.0.0.0

So after you issue:
Code:
service restart_dnsmasq

do the two lines appear in /etc/dnsmasq.conf ?
 
no they don't, it's still the config that was loaded when router was rebooted. clear-on-reload is not there and 2 old address= entries that I removed are still there from last reboot. I didnt know thats how it worked...seems like its not reading in the conf.add file when restarting the service
 
no they don't, it's still the config that was loaded when router was rebooted. clear-on-reload is not there and 2 old address= entries that I removed are still there from last reboot. I didnt know thats how it worked...seems like its not reading in the conf.add file when restarting the service

So either you have not enabled the processing of the Custom /JFFS files in the GUI (see Administration -> System)

'Enable JFFS custom scripts and configs=Yes'

or the file is not in the correct format...issue
Code:
dos2unix /jffs/configs/dnsmasq.conf.add
 
Last edited:
I do have custom scripts enabled and it is working because my ddns is working from custom script. I was suspicious that I have copied text in from Windows into the conf file, so I tried dos2unix but it didnt help after a restart (old config still in /etc/dnsmasq.comf). I deleted the file and created a new one from scrath with one line in it, restarted dnsmasq but still no luck :(
 
.add files go in /jffs/configs/ not in /jffs/scripts/ .
 
I do have custom scripts enabled....I deleted the file and created a new one from scrath with one line in it, restarted dnsmasq but still no luck :(

Well, if there are no 'custom' messages in Syslog when you bounce dnsmasq,
Code:
RT-AC68U kern.notice rc_service: service 8206:notify_rc restart_dnsmasq
RT-AC68U kern.notice custom config: Appending content of /jffs/configs/dnsmasq.conf.add.

then perhaps you can try creating the script

/jffs/scripts/dnsmasq.postconf

to add the line?
 
aha.

admin@merlin:/jffs/configs# service dnsmasq_stop

Done.
admin@merlin:/jffs/configs# ps|grep dns
748 admin 3464 S dnscrypt-proxy --local-address=127.0.0.1:65053 --dae
803 nobody 1440 S dnsmasq --log-async
1605 admin 1396 S grep dns

kill -9 803
admin@merlin:/jffs/configs# ps|grep dns
748 admin 3464 S dnscrypt-proxy --local-address=127.0.0.1:65053 --dae
1611 admin 1396 S grep dns

admin@merlin:/jffs/configs# /opt/etc/init.d/S09dnscrypt-proxy check
Checking ... alive.
admin@merlin:/jffs/configs# /opt/etc/init.d/S09dnscrypt-proxy stop
Checking ... alive.
Shutting down dnscrypt-proxy... done.
admin@merlin:/jffs/configs# /opt/etc/init.d/S09dnscrypt-proxy check
Checking ... dead.
admin@merlin:/jffs/configs# service dnsmasq_start

Done.
admin@merlin:/jffs/configs# ps |grep dns
1637 nobody 1372 S dnsmasq --log-async
1644 admin 1396 S grep dns


And now it magically loads the dnsmasq.conf.add file. I thought I'd disabled DNScrypt in the startup script, but apparently not. Either it's the fact that dnscrypt has still got hooks into dnsmasq in some way, or the service dnsmasq_restart isnt actually stopping the service properly... wait, i'll test that now...

No! It's not killing the service, I need to kill it manually for it to reload the add file. Nothing to do with dnscrypt.
 
...service dnsmasq_restart isnt actually stopping the service properly

That's because the correct command is:

service restart_dnsmasq :rolleyes:

or

service stop_dnsmasq instead of the incorrect service dnsmasq_stop followed by
service start_dnsmasq
 
is there a way to delete a thread in the forums so I dont look like an asshat for eternity? ;)

Ta very much for the help. There's a saying in support i'm sure you've heard of... "the problem is between the chair and the keyboard".
 
is there a way to delete a thread in the forums so I dont look like an asshat for eternity? ;)

Sadly no?, besides where would the fun be if there was? :D

P.S. There are some people that shouldn't be allowed in the same room as a computer - let alone be allowed to bash on the keyboard with their knuckles!" :p
 
P.S. There are some people that shouldn't be allowed in the same room as a computer - let alone be allowed to bash on the keyboard with their knuckles!" :p

They fall under various service codes:

The mild one: Code 18 - problem is 18 inches away from the monitor
Code ID-10-T - for the worst cases (remove the dashes to understand that one)
 
They fall under various service codes:

The mild one: Code 18 - problem is 18 inches away from the monitor
Code ID-10-T - for the worst cases (remove the dashes to understand that one)

Indeed! :D

However, joking aside, it really isn't the fault of the OP when this is allowed :rolleyes:

Code:
admin@RT-AC68U:/tmp/home/root# service    IcanTypeAnythingHere_andStatusDONEisALWAYSreturned!
Done.
admin@RT-AC68U:/tmp/home/root#
 
However, joking aside, it really isn't the fault of the OP when this is allowed

I know. I took a look at it a few years ago, and fixing it wouldn't be trivial due to the way Asus implemented this (it's their code). If I remember correctly, it's because the service command does not directly launch the process - it merely sends a notification event to the parent process, without knowing if the command is valid or not.
 
I know. I took a look at it a few years ago, and fixing it wouldn't be trivial due to the way Asus implemented this (it's their code). If I remember correctly, it's because the service command does not directly launch the process - it merely sends a notification event to the parent process, without knowing if the command is valid or not.
I already added a syslog error message for this....I'll look and see about a console message as well.
 
I already added a syslog error message for this....I'll look and see about a console message as well.
I cannot tell how many times this has bugged me.
Issuing a service whatever_restart and the result is:
Code:
tlc@RT-AC1900P:/tmp/home/root# service whatever_restart

Done.
I now have a list of these commands always open when I code.
No, Asus, you are never again going to fool me into believing the service 'whatever' has done restarting....

Edit: This is the syslog entry on a merlin fw router:
Code:
Mar 31 20:35:23 rc_service: service 6091:notify_rc whatever_restart
 
Last edited:
I already added a syslog error message for this....I'll look and see about a console message as well.

That's the tricky part. Basically, the service command merely notifies the init process, and immediately returns, not knowing what happened with the notification it submitted. That's also why it immediately returns, even if the service takes much longer to restart.

And remember that the notify code is now closed source...
 

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