What's new

AdGuardHome [RELEASE] Asuswrt-Merlin-AdGuardHome-Installer (AMAGHI)

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

Some strange behaviour, AdGuardHome stopped working for no reason and a manual start was done. However after a few minutes, the service stopped by itself again
Code:
Feb  6 16:27:00 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:27:00.393600 [info] Listening to tcp://[::]:53
Feb  6 16:27:00 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:27:00.418001 [info] Entering the UDP listener loop on [::]:53
Feb  6 16:27:00 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:27:00.420254 [info] Entering the tcp listener loop on [::]:53
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.154998 [info] Received signal "interrupt"
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.155085 [info] stopping AdGuard Home
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.155103 [info] stopping http server...
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.177164 [info] stopped http server
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.177301 [info] Stopping the DNS proxy server
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.177517 [info] Stopped the DNS proxy server
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.201714 [info] Stopped
 
Some strange behaviour, AdGuardHome stopped working for no reason and a manual start was done. However after a few minutes, the service stopped by itself again
Code:
Feb  6 16:27:00 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:27:00.393600 [info] Listening to tcp://[::]:53
Feb  6 16:27:00 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:27:00.418001 [info] Entering the UDP listener loop on [::]:53
Feb  6 16:27:00 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:27:00.420254 [info] Entering the tcp listener loop on [::]:53
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.154998 [info] Received signal "interrupt"
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.155085 [info] stopping AdGuard Home
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.155103 [info] stopping http server...
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.177164 [info] stopped http server
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.177301 [info] Stopping the DNS proxy server
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.177517 [info] Stopped the DNS proxy server
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.201714 [info] Stopped
@SomeWhereOverTheRainBow has put debug verbose option in /opt/etc/init.d/S99AdGuardHome. Perhaps you can try enable it and see if there is any abnormality before it stop.

LOG_VERB="--verbose" #to enable verbose add $LOG_VERB to the end of ARGS

Edit this line
Code:
ARGS="-s run -c "${WORK_DIR}/AdGuardHome.yaml" -w "$WORK_DIR" --pidfile "$PID_FILE" --no-check-update -l "$LOG_FILE""
to
Code:
ARGS="-s run -c "${WORK_DIR}/AdGuardHome.yaml" -w "$WORK_DIR" --pidfile "$PID_FILE" --no-check-update -l "$LOG_FILE" $LOG_VERB"

Then run /opt/etc/init.d/S99AdGuardHome restart
 
Some strange behaviour, AdGuardHome stopped working for no reason and a manual start was done. However after a few minutes, the service stopped by itself again
Code:
Feb  6 16:27:00 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:27:00.393600 [info] Listening to tcp://[::]:53
Feb  6 16:27:00 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:27:00.418001 [info] Entering the UDP listener loop on [::]:53
Feb  6 16:27:00 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:27:00.420254 [info] Entering the tcp listener loop on [::]:53
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.154998 [info] Received signal "interrupt"
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.155085 [info] stopping AdGuard Home
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.155103 [info] stopping http server...
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.177164 [info] stopped http server
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.177301 [info] Stopping the DNS proxy server
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.177517 [info] Stopped the DNS proxy server
Feb  6 16:31:40 RT-AC86U-7510 AdGuardHome[11447]: 2022/02/06 16:31:40.201714 [info] Stopped
@SomeWhereOverTheRainBow probably not best practise, but could you add
Code:
trap '' SIGINT
as a pre-arg or similar ? not sure if this would work, but i use something similar in my scripts (albeit with SIGHUP) to avoid the process getting terminated
 
There have been cases where a ctrl-c in a terminal would terminate a daemon spawned from the same session. Sounded familiar to me:

 
There have been cases where a ctrl-c in a terminal would terminate a daemon spawned from the same session. Sounded familiar to me:

That seems to be what is happening to me.

Within the same terminal session,
1. start the AGH daemon
2. tail -f the log
3. ctrl + c the tail
4. seems like that sends the "interrupt" signal to AGH daemon

[EDIT 1] more or less confirmed that this is the cause of the issue as I tried to repeat the above mentioned steps while monitoring the logs through the admin GUI log output

[EDIT 2] Exiting the same terminal session that initiated the AGH daemon sends the "hangup" signal to AGH
 
Last edited:
There have been cases where a ctrl-c in a terminal would terminate a daemon spawned from the same session. Sounded familiar to me:

Sounds like the process might not be fully breaking off to run on its own, nohup isn't doing the job. I may have to try something else.

That also explains what might have been happening when I sent logs to syslog. If one were using scribe syslogng I wonder if adguardhome process would be killed when it scribe kills the standard syslog
 
Last edited:
That seems to be what is happening to me.

Within the same terminal session,
1. start the AGH daemon
2. tail -f the log
3. ctrl + c the tail
4. seems like that sends the "interrupt" signal to AGH daemon

[EDIT 1] more or less confirmed that this is the cause of the issue as I tried to repeat the above mentioned steps while monitoring the logs through the admin GUI log output

[EDIT 2] Exiting the same terminal session that initiated the AGH daemon sends the "hangup" signal to AGH
apparently it gets the interupt signal way before hitting ctrl+C

when i do "tail f" to the log, it disconnects immediately at that point. which is before hitting control+c here is me trapping the interrupt.

Code:
 trap "" 2 && /usr/bin/tail -f /opt/var/log/AdGuardHome.log
2022/02/06 20:48:42.591879 [info] Ratelimit is enabled and set to 20 rps
2022/02/06 20:48:42.591896 [info] The server is configured to refuse ANY requests
2022/02/06 20:48:42.591911 [info] DNS cache is enabled
2022/02/06 20:48:42.591938 [info] MaxGoroutines is set to 300
2022/02/06 20:48:42.591977 [info] Creating the UDP server socket
2022/02/06 20:48:42.592260 [info] Listening to udp://[::]:53
2022/02/06 20:48:42.592281 [info] Creating a TCP server socket
2022/02/06 20:48:42.592383 [info] Listening to tcp://[::]:53
2022/02/06 20:48:42.595097 [info] Entering the tcp listener loop on [::]:53
2022/02/06 20:48:42.595150 [info] Entering the UDP listener loop on [::]:53
2022/02/06 20:49:03.718043 [info] Received signal "interrupt"
2022/02/06 20:49:03.718102 [info] stopping AdGuard Home
2022/02/06 20:49:03.718115 [info] stopping http server...
2022/02/06 20:49:03.724476 [info] stopped http server
2022/02/06 20:49:03.724560 [info] Stopping the DNS proxy server
2022/02/06 20:49:03.724662 [info] Stopped the DNS proxy server
2022/02/06 20:49:03.734638 [info] Stopped
 
That seems to be what is happening to me.

Within the same terminal session,
1. start the AGH daemon
2. tail -f the log
3. ctrl + c the tail
4. seems like that sends the "interrupt" signal to AGH daemon

[EDIT 1] more or less confirmed that this is the cause of the issue as I tried to repeat the above mentioned steps while monitoring the logs through the admin GUI log output

[EDIT 2] Exiting the same terminal session that initiated the AGH daemon sends the "hangup" signal to AGH
however, when I use trap "" 15

Code:
trap "" 15 && /usr/bin/tail -f /opt/var/log/AdGuardHome.log
2022/02/06 20:52:39.510662 [info] Ratelimit is enabled and set to 20 rps
2022/02/06 20:52:39.510676 [info] The server is configured to refuse ANY requests
2022/02/06 20:52:39.510693 [info] DNS cache is enabled
2022/02/06 20:52:39.510720 [info] MaxGoroutines is set to 300
2022/02/06 20:52:39.510768 [info] Creating the UDP server socket
2022/02/06 20:52:39.510980 [info] Listening to udp://[::]:53
2022/02/06 20:52:39.510997 [info] Creating a TCP server socket
2022/02/06 20:52:39.511099 [info] Listening to tcp://[::]:53
2022/02/06 20:52:39.513590 [info] Entering the tcp listener loop on [::]:53
2022/02/06 20:52:39.513739 [info] Entering the UDP listener loop on [::]:53
2022/02/06 20:53:56.344429 [info] auth: user "#######" successfully logged in from ip 192.168.1.###
Before doing tail -f

Adguardhome stays running and I can view the log

But, once I control+c out the program stops
 

Seems unusual that they want to do this deliberately.

It probably has something to do with preventing the data base becoming corrupt, it allows adguardhome to properly shutdown instead of crashing, but it is buggy. I am not sure though, but it seems intention by design

Seems unusual that they want to do this deliberately.

That is probably why the process is getting killed, whenever syslogng takes over when ever any one is running scribe, it kills all of those processes, which must be killing adguardhome (or adguardhome thinks it is the signal to kill itself). The only thing i can think to do is disable logging all together which will send it to "stdout"

A issue has been created


For the meantime I have pushed a patch that disabled the logging of AdGuardHomes actions. This does not mean adguardhome is not working on its own, it just means it will not make invalid judgement calls to self terminate, but this will need some testing. Once AdGuardHome resolves the bug, I will re-enable the logging.
 
Last edited:
That seems to be what is happening to me.

[EDIT 2] Exiting the same terminal session that initiated the AGH daemon sends the "hangup" signal to AGH
How are you starting it? (nohup (a.k.a nohangup) used in the init.d script should allow it to keep running once the terminal closes) I am able to exit the terminal session just fine without it getting a hangup signal, it seems the only way I am able to do a hangup signal is from inside tail -f.
 
Interesting updates to this thread.

I had made this change to the yaml file to see if I could catch better info. No crashes yet, wonder if that is a work around for people running syslog-ng. (scribe).

log_file: syslog
 
How are you starting it? (nohup (a.k.a nohangup) used in the init.d script should allow it to keep running once the terminal closes) I am able to exit the terminal session just fine without it getting a hangup signal, it seems the only way I am able to do a hangup signal is from inside tail -f.
Was started using the S99AdGuardHome script. Somehow I was not able to reproduce when doing a retry again. Guess can just ignore this comment
 
Was started using the S99AdGuardHome script. Somehow I was not able to reproduce when doing a retry again. Guess can just ignore this comment
Can you check and see if you have the same hang up issues when using GNU tail by using

/usr/bin/tail -f

To view the logs.

Instead of

generic

tail -f
Which may be the one tied to busybox tail.
 
Hello colleagues,

I have been testing Adguard on my RT-AC86U for a little while now. Unfortunately, I found out quite early on that the speed of the DNS resolution and the speed of the web interface was very slow. I tested this with very little DNS blacklists and with a lot. Unfortunately, the problem was always the same. Can anyone confirm that this is a little slower? But with Diversion and almost 2.2 million entries I have no problems.

Another question regarding DNS over HTTPS or DNS over TLS: Can this only be activated if you have a certificate and enter it? Unfortunately, I was unsure.

Thanks for the implementation anyway!
 
I think the speed is almost the same on diversion or adguard.. On my AX86U, i use Unbound and AdGuard, and i have 750.000 on the blocklists in AdGuard. Not much CPU load, but when the lists updates the CPU load rises. 651MB Ram used..
 
Hello colleagues,

I have been testing Adguard on my RT-AC86U for a little while now. Unfortunately, I found out quite early on that the speed of the DNS resolution and the speed of the web interface was very slow. I tested this with very little DNS blacklists and with a lot. Unfortunately, the problem was always the same. Can anyone confirm that this is a little slower? But with Diversion and almost 2.2 million entries I have no problems.

Another question regarding DNS over HTTPS or DNS over TLS: Can this only be activated if you have a certificate and enter it? Unfortunately, I was unsure.

Thanks for the implementation anyway!
Speed should not be an issue between Diversion or AdGuard.

Regarding DoT/ DoH, I presume you mean how to use these for upstream DNS resolution. Under DNS settings, in upstream servers, use only DoH or DoT servers.
Example.. use the following
Code:
https://dns.cloudflare.com/dns-query
tls://1dot1dot1dot1.cloudflare-dns.com
https://dns.google/dns-query
tls://dns.google
instead of
Code:
1.1.1.1
8.8.8.8

And your upstream queries will be DoH and DoT Rather than plain DNS over port 53.

The encryption settings section that requires a certificate to enable DoH/ DoT is for downstream clients.
You really do not need this when running AdGuard Home on a router as it is your local router itself that is requesting the DNS query; so it makes no sense sending a DoT/DoH request locally.

The encryption settings page is mainly used when running AdGuardHome as a full fledged server on a public accessible machine serving DNS queries over the internet; on a local machine/ device, it does not add much value.
 
Hello colleagues,

I have been testing Adguard on my RT-AC86U for a little while now. Unfortunately, I found out quite early on that the speed of the DNS resolution and the speed of the web interface was very slow. I tested this with very little DNS blacklists and with a lot. Unfortunately, the problem was always the same. Can anyone confirm that this is a little slower? But with Diversion and almost 2.2 million entries I have no problems.

Another question regarding DNS over HTTPS or DNS over TLS: Can this only be activated if you have a certificate and enter it? Unfortunately, I was unsure.

Thanks for the implementation anyway!
turn on the optimistic caching. it is the router resources. AdGuardHome will run much better with optimistic caching turned on. Openwrt users experienced the same issue, most found solution with optimistic caching enabled
 
At the moment AdGuardHome Devs are unable to reproduce this same system call issue.


I have been posting as much as I can to try to get this resolved. If any one here has any more information they want to share with the Devs you are welcome to chime in because it could help make AdGuardHome a more viable solution for adblock on asuswrt-merlin routers.
 

Similar threads

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