What's new

Diversion dnsmasg log resetting doesn't work on Asus GT-AX11000 Pro

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

Pyrrhus Zaurus

Occasional Visitor
Hi !
I'm on ASUSWRT-Merlin GT-AX11000_PRO 3004.388.4_0_rog freshly installed on my new router,
Diversion 4.3.3
scribe 3.2.0
uiDivStats 3.0.2
uiScribe 1.4.5
Entware aarch64-k3.10 and sshfs installed

Everything work as expected except the resetting of dnsmasq log file.
'cru l' shows the job is scheduled but the log file size is increasing day after day

Manually, it works :
amtm > 1 Diversion > 1233 > d > 7 (reset) > 2 (Reset Dnsmasq log files)

So, can we 'repair' the cron job ?

Thank you !
 

Attachments

  • Capture d’écran 2023-08-24 à 12.03.42.png
    Capture d’écran 2023-08-24 à 12.03.42.png
    50.5 KB · Views: 27
Is anything written to the system log by Diversion at 5:20AM each day?

What do the files look like now?
Code:
ls -l /opt/var/log/dnsmasq*
 
This is the result:

Bash:
-rw-rw----    1 nobody   root       2860745 Aug 24 15:37 /opt/var/log/dnsmasq.log
-rw-r-----    1 nobody   root             0 Aug 24 12:28 /opt/var/log/dnsmasq.log1
-rw-r-----    1 nobody   root             0 Aug 24 12:28 /opt/var/log/dnsmasq.log2
 
This is the result:

Bash:
-rw-rw----    1 nobody   root       2860745 Aug 24 15:37 /opt/var/log/dnsmasq.log
-rw-r-----    1 nobody   root             0 Aug 24 12:28 /opt/var/log/dnsmasq.log1
-rw-r-----    1 nobody   root             0 Aug 24 12:28 /opt/var/log/dnsmasq.log2
Is Scribe rotating the dnsmasq.log file also?
 
How to check this ?
Not sure since I never used Scribe. What about any other syslog messages from 5:20 AM every day when the cron runs? Or run the cron command manually right now:
Code:
/bin/sh /opt/share/diversion/file/rotate-logs.div
 
Bash:
/jffs/syslog.log:Aug 24 00:40:01 GT-AX11000_Pro-C5D0 Diversion: found 1 new YouTube hosts, total is 73 (counter at 21 of 30)
/jffs/syslog.log:Aug 24 00:41:01 GT-AX11000_Pro-C5D0 Diversion: found 2 new YouTube hosts, total is 75 (counter at 0 of 30)
/jffs/syslog.log:Aug 24 01:02:01 GT-AX11000_Pro-C5D0 Diversion: found 1 new YouTube hosts, total is 76 (counter at 15 of 30)
/jffs/syslog.log:Aug 24 01:09:01 GT-AX11000_Pro-C5D0 Diversion: found 1 new YouTube hosts, total is 77 (counter at 6 of 30)
/jffs/syslog.log:Aug 24 01:13:01 GT-AX11000_Pro-C5D0 Diversion: found 2 new YouTube hosts, total is 79 (counter at 3 of 30)
/jffs/syslog.log:Aug 24 01:40:01 GT-AX11000_Pro-C5D0 Diversion: found 3 new YouTube hosts, total is 82 (counter at 17 of 30)
/jffs/syslog.log:Aug 24 01:52:01 GT-AX11000_Pro-C5D0 Diversion: found 1 new YouTube hosts, total is 83 (counter at 11 of 30)
/jffs/syslog.log:Aug 24 05:20:06 GT-AX11000_Pro-C5D0 Diversion: rotated dnsmasq log files
/jffs/syslog.log:Aug 24 11:30:01 GT-AX11000_Pro-C5D0 Diversion: found 1 new YouTube hosts, total is 84 (counter at 28 of 30)
/jffs/syslog.log:Aug 24 12:15:15 GT-AX11000_Pro-C5D0 Diversion: disabling services for unmount
/jffs/syslog.log:Aug 24 12:18:47 Diversion: Starting Entware and Diversion services on /tmp/mnt/rog-disk
/jffs/syslog.log:Aug 24 12:18:49 GT-AX11000_Pro-C5D0 Diversion: Mounting Diversion WebUI page
/jffs/syslog.log:Aug 24 12:18:50 GT-AX11000_Pro-C5D0 Diversion: Mounted Diversion WebUI as user1.asp in LAN/Diversion
/jffs/syslog.log:Aug 24 12:18:50 GT-AX11000_Pro-C5D0 Diversion: restarted Dnsmasq to apply settings
/jffs/syslog.log:Aug 24 12:28:58 GT-AX11000_Pro-C5D0 Diversion: reset dnsmasq log files (user action), from Diversion menu
/jffs/syslog.log:Aug 24 12:30:35 GT-AX11000_Pro-C5D0 Diversion: created br0:pixelserv-tls for 192.168.1.2
/jffs/syslog.log:Aug 24 12:30:35 GT-AX11000_Pro-C5D0 Diversion: restarted Dnsmasq to apply settings
/jffs/syslog.log:Aug 24 12:30:36 GT-AX11000_Pro-C5D0 Entware (aarch64-k3.10): Started pixelserv-tls (Diversion)
/jffs/syslog.log:Aug 24 13:40:01 GT-AX11000_Pro-C5D0 Diversion: found 4 new YouTube hosts, total is 88 (counter at 25 of 30)
/jffs/syslog.log:Aug 24 16:01:53 GT-AX11000_Pro-C5D0 Diversion: rotated dnsmasq log files
/opt/var/log/messages:Aug 24 00:40:01 GT-AX11000_Pro-C5D0 Diversion: found 1 new YouTube hosts, total is 73 (counter at 21 of 30)
/opt/var/log/messages:Aug 24 00:41:01 GT-AX11000_Pro-C5D0 Diversion: found 2 new YouTube hosts, total is 75 (counter at 0 of 30)
/opt/var/log/messages:Aug 24 01:02:01 GT-AX11000_Pro-C5D0 Diversion: found 1 new YouTube hosts, total is 76 (counter at 15 of 30)
/opt/var/log/messages:Aug 24 01:09:01 GT-AX11000_Pro-C5D0 Diversion: found 1 new YouTube hosts, total is 77 (counter at 6 of 30)
/opt/var/log/messages:Aug 24 01:13:01 GT-AX11000_Pro-C5D0 Diversion: found 2 new YouTube hosts, total is 79 (counter at 3 of 30)
/opt/var/log/messages:Aug 24 01:40:01 GT-AX11000_Pro-C5D0 Diversion: found 3 new YouTube hosts, total is 82 (counter at 17 of 30)
/opt/var/log/messages:Aug 24 01:52:01 GT-AX11000_Pro-C5D0 Diversion: found 1 new YouTube hosts, total is 83 (counter at 11 of 30)
/opt/var/log/messages:Aug 24 05:20:06 GT-AX11000_Pro-C5D0 Diversion: rotated dnsmasq log files
/opt/var/log/messages:Aug 24 11:30:01 GT-AX11000_Pro-C5D0 Diversion: found 1 new YouTube hosts, total is 84 (counter at 28 of 30)
/opt/var/log/messages:Aug 24 12:15:15 GT-AX11000_Pro-C5D0 Diversion: disabling services for unmount
/opt/var/log/messages:Aug 24 12:18:47 Diversion: Starting Entware and Diversion services on /tmp/mnt/rog-disk
/opt/var/log/messages:Aug 24 12:18:49 GT-AX11000_Pro-C5D0 Diversion: Mounting Diversion WebUI page
/opt/var/log/messages:Aug 24 12:18:50 GT-AX11000_Pro-C5D0 Diversion: Mounted Diversion WebUI as user1.asp in LAN/Diversion
/opt/var/log/messages:Aug 24 12:18:50 GT-AX11000_Pro-C5D0 Diversion: restarted Dnsmasq to apply settings
/opt/var/log/messages:Aug 24 12:28:58 GT-AX11000_Pro-C5D0 Diversion: reset dnsmasq log files (user action), from Diversion menu
/opt/var/log/messages:Aug 24 12:30:35 GT-AX11000_Pro-C5D0 Diversion: created br0:pixelserv-tls for 192.168.1.2
/opt/var/log/messages:Aug 24 12:30:35 GT-AX11000_Pro-C5D0 Diversion: restarted Dnsmasq to apply settings
/opt/var/log/messages:Aug 24 12:30:36 GT-AX11000_Pro-C5D0 Entware (aarch64-k3.10): Started pixelserv-tls (Diversion)
/opt/var/log/messages:Aug 24 13:40:01 GT-AX11000_Pro-C5D0 Diversion: found 4 new YouTube hosts, total is 88 (counter at 25 of 30)
/opt/var/log/messages:Aug 24 16:01:53 GT-AX11000_Pro-C5D0 Diversion: rotated dnsmasq log files
 
Ok, the script believes it is rotating the files. My last idea is to run the script with shell debugging just to see what it thinks it’s doing.
Code:
/bin/sh -x /opt/share/diversion/file/rotate-logs.div
 
Ok here we go:

Bash:
+ DIVERSION_DIR=/opt/share/diversion
+ [ -f /opt/share/diversion/.conf/diversion.conf ]
+ . /opt/share/diversion/.conf/diversion.conf
+ NAME=Diversion
+ thisVERSION=4.3.3
+ EDITION=Standard
+ THEME=reduced_cw
+ INSTALL_URL=https://diversion.ch/diversion
+ DIVERSION_STATUS=enabled
+ UNMOUNT_STATUS=
+ adblocking=on
+ logging=on
+ webUi=enabled
+ editorColor=
+ editorPaginate=
+ editorAutowww=
+ snbAdSupport=yes
+ blUpdateErr=
+ bfType=Standard
+ bfUpdateDay=Tuesday
+ bfUpdateDOW=Tue
+ bfUpdateHour=2
+ bfUpdateLastRun=Aug 22 02:00:49
+ bfUpdatePrevRun=
+ blockingIP=192.168.1.2
+ domainsPerLine=20
+ ytBlocking=on
+ showYTcount=
+ ytIPv4GV=184.150.37.141
+ ytIPv6GV=
+ ytIPalternating=
+ YTredirs=595
+ YTredirsWeek=460
+ YTredirsNew=0
+ blockType65=disabled
+ dropCaches=enabled
+ entPath=/tmp/mnt/rog-disk/entware
+ entVersion=Entware (aarch64-k3.10)
+ psVersion=v2.4
+ psState=on
+ prevPsState=
+ psIP=192.168.1.2
+ bfDomains=211362
+ blockedDomains=211362
+ adsBlocked=32683
+ adsWeek=13371
+ adsNew=767
+ adsPrevCount=Aug 24 05:20
+ adsLastCount=Aug 24 16:01
+ adsCounter=off
+ adsCountLM=Aug 24 16:01:42 dnsmasq\[13109\]: cached googlehosted.l.googleusercontent.com is 172.217.13.193
+ [ -f /opt/var/log/dnsmasq.log ]
+ diversion count_ads

+ [  = on ]
+ find /opt/var/log/dnsmasq.log /opt/var/log/dnsmasq.log1 /opt/var/log/dnsmasq.log2 -mtime +8
+ [  ]
+ [ ! -f /opt/var/log/dnsmasq.log1 ]
+ cat /opt/var/log/dnsmasq.log1
+ mv /opt/var/log/dnsmasq.log /opt/var/log/dnsmasq.log1
+
+ [  = on ]
+ chown nobody /opt/var/log/dnsmasq.log /opt/var/log/dnsmasq.log1 /opt/var/log/dnsmasq.log2
+ chmod 0640 /opt/var/log/dnsmasq.log /opt/var/log/dnsmasq.log1 /opt/var/log/dnsmasq.log2
+ pidof dnsmasq
+ kill -USR2 13110 13109
+ logger -t Diversion rotated dnsmasq log files
+ exit 0
 
Please list the files again.
Code:
ls -l /opt/var/log/dnsmasq*
If the log1 and log2 are still zero, just try running this manually:
Code:
cat /opt/var/log/dnsmasq.log1 >>/opt/var/log/dnsmasq.log2
mv /opt/var/log/dnsmasq.log /opt/var/log/dnsmasq.log1
>/opt/var/log/dnsmasq.log
kill -USR2 $(pidof dnsmasq)
ls -l /opt/var/log/dnsmasq*
Also, for sanity, please run:
Code:
which cat mv
 
Last edited:
Apparently log1 and log2 not empty:

Bash:
-rw-r-----    1 nobody   root        429984 Aug 24 17:21 /opt/var/log/dnsmasq.log
-rw-r-----    1 nobody   root        291986 Aug 24 16:29 /opt/var/log/dnsmasq.log1
-rw-r-----    1 nobody   root       3045649 Aug 24 16:29 /opt/var/log/dnsmasq.log2

What are the conclusions ? 😅
 
I see the system timezone is different from the one I've set in the webui. It seems UTC -3 in the logs but mine is UTC -4 (Toronto)
 
Maybe it’s a misunderstanding of what to expect. dnsmasq.log2 will grow every day and gets reset after 7 days. dnsmasq.log1 will always contain the previous day’s log. dnsmasq.log will always contain the current day logs from 5:20AM onward.

A log reset isn’t the same as the log rotate.
 
So, as a workaround, can you provide the job to add in cru to mimic this ?

Code:
amtm > 1 Diversion > 1233 > d > 7 (reset) > 2 (Reset Dnsmasq log files)
 
So, as a workaround, can you provide the job to add in cru to mimic this ?

Code:
amtm > 1 Diversion > 1233 > d > 7 (reset) > 2 (Reset Dnsmasq log files)
Lets clarify the break down of what @dave14305 provided in his previous post. He may correct me where I am wrong.

Code:
cat /opt/var/log/dnsmasq.log1 >>/opt/var/log/dnsmasq.log2 # Append Current Todays Log to existing Log Backup.
mv /opt/var/log/dnsmasq.log /opt/var/log/dnsmasq.log1 # Move the current log entries to Todays Log.
>/opt/var/log/dnsmasq.log # Start with a cleared log
kill -USR2 $(pidof dnsmasq)
ls -l /opt/var/log/dnsmasq*
 

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