Jack Yaz
Part of the Furniture
I hear ya!I need a break from coding. T'was a good excuse to stop my feature creep tendency.
I hear ya!I need a break from coding. T'was a good excuse to stop my feature creep tendency.
I agree! Don't let your hobby turn into something you can't enjoy.No point in burning yourselves out, @thelonelycoder & @Jack Yaz.
I haven't gotten around to installing entware/diversion on my ac86 (used to have it on my n66...big upgrade), but I have a question:
this appears such that I can install amtm in scripts, use it to format a USB drive and run a swap BEFORE getting entware etc happening - is that correct?
Yup, in that order.I haven't gotten around to installing entware/diversion on my ac86 (used to have it on my n66...big upgrade), but I have a question:
this appears such that I can install amtm in scripts, use it to format a USB drive and run a swap BEFORE getting entware etc happening - is that correct?
I remember spending my time doing something else (on the computer). Then I had an idea and in the process of it stumbled upon this forum and found Asuswrt-Merlin. That was sometime in January 2014. My live has been transformed since.Before you came along, I would install a script, probably mess it up, never update, and finally just reformat jffs since I blamed the scripts for whatever the days router problems were.
I'm good, thanks. They're nice, aren't they?Thanks, and please ignore the bitching about themes.
I did reject your request in the Diversion thread. Here, in the amtm thread, I realized that your proposal is advantageous for the disk check script and others.Apologies in advance ... I'm sure you are kept busy enough without me chiming in ... but here comes another "non-coder" feature request: -
Relates to my post under fw 384.12-alpha1 here ... https://www.snbforums.com/threads/384-12_alpha-builds-testing-all-variants.56639/page-6#post-492419 ... but not sure that firmware change is feasible.
I then discovered this post [dealing with another issue - but with ntp sync at the heart of the problem] https://www.snbforums.com/threads/t...ugged-on-rt-ax88u-11.56524/page-2#post-492172
So ... I thought perhaps the solution for your amtm / disk check ... and its many add-on scripts - was to build in a short delay - [10 to 20 seconds?] -before any of the amtm provided scripts execute - so that the WAN is up and ntp is in sync first?
Not only would this give an accurate time stamp for Disk Check log - but also possibly resolve some of the other issues which arise for lack of ntp sync?
May 22 19:37:48 amtm disk-check: Waited 2 seconds for NTP to sync date
May 22 19:37:48 amtm disk-check: Probing ext4 on device /dev/sdb1
May 22 19:37:48 amtm disk-check: Running disk check (v2.2) 'e2fsck -p' on /dev/sdb1
May 22 19:37:48 amtm disk-check: Disk check done on /dev/sdb1
I did reject your request in the Diversion thread. Here, in the amtm thread, I realized that your proposal is advantageous for the disk check script and others.
The timeout for NPT to sync is 30 seconds, then it will run anyway.Code:May 22 19:37:48 amtm disk-check: Waited 2 seconds for NTP to sync date May 22 19:37:48 amtm disk-check: Probing ext4 on device /dev/sdb1 May 22 19:37:48 amtm disk-check: Running disk check (v2.2) 'e2fsck -p' on /dev/sdb1 May 22 19:37:48 amtm disk-check: Disk check done on /dev/sdb1
Coming to a router near you with the next amtm update.
YazFi doesn't need NTP - the lock files are where the firewall is restarted multiple times during the system bootThanks for that {thumbs-Up} ... it will fix the time stamp for disk-check - but I remain convinced that, through your control of what is approved for inclusion in the amtm menu system, a collaborative effort can be achieved for all coder participants to have the /jffs/script execution delayed for that 30 second period to get time synced before they execute.
In the syslog extract I quoted in the "rejected" post it is clear that "firewall-start" kicks off first well before any time sync has occurred. That kicks off skynet and yazfi - leaving them looping around "lock file" issues until time is in sync when they can execute properly. There are several other instances of these /jffs/scripts firing up without time in sync [can't see the point of this?].
I also wonder whether the process has to wait a full 30 seconds - could an internment test not run to check time sync - and as soon as sync occurs ... proceed with script execution. The ntp delay test should exit anyway when 30 seconds have elapsed and no confirmation of time sync is received?
EDIT : ntpstat command?
30s is the timeout to run it anyway, else it runs whenever NTP is synced.I also wonder whether the process has to wait a full 30 seconds - could an internment test not run to check time sync - and as soon as sync occurs ... proceed with script execution. The ntp delay test should exit anyway when 30 seconds have elapsed and no confirmation of time sync is received?
ntptimer=0
ntptimeout=30
while [ "$(nvram get ntp_ready)" = "0" ] && [ "$ntptimer" -lt "$ntptimeout" ]; do
ntptimer=$((ntptimer+1))
sleep 1
done
I would be very much against an across the board approach that would impact everyone. If your system needs time as quickly as possible, there are relatively easy ways to achieve this. The easiest is to set up a system as a time server (with a static IP) and put a loop in init-start to continuously query the IP of that system until the LAN comes up, then get the time and set ntp_ready. I have a raspberry pi I use for a time server (it gets GPS time), and it gets time within 2 seconds of being started. I'm pretty sure the LAN comes up before the WAN, and certainly before DNS, so using a time server internal to your network is the very fastest way to get time. I'll put a script up in Gist of what I use.Thanks for that {thumbs-Up} ... it will fix the time stamp for disk-check - but I remain convinced that, through your control of what is approved for inclusion in the amtm menu system, a collaborative effort can be achieved for all coder participants to have the /jffs/script execution delayed for that 30 second period to get time synced before they execute.
See my Gist at: https://gist.github.com/cynicastic/ced78fac27de4394b67977802d76c0d9 - put it in /jffs/scripts, make it executable, and call from init-start withThanks for that {thumbs-Up} ... it will fix the time stamp for disk-check - but I remain convinced that, through your control of what is approved for inclusion in the amtm menu system, a collaborative effort can be achieved for all coder participants to have the /jffs/script execution delayed for that 30 second period to get time synced before they execute.
/jffs/scripts/fetch-ntp ww.xx.yy.zz cc &
May 4 22:05:06 nat: apply redirect rules
May 4 22:05:06 dropbear[776]: Running in background
May 8 19:59:48 SCRIPT_fetch-ntp: Time synced (Wed May 8 19:59:48 DST 2019) from W.X.Y.Z in 2 cycles
Hmmm.So will the script be applicable if the Router is the ntp server?
I guess its good for a message to the log !!Hmmm.
Agreed - which is why the solution rests with amtm and any of its scripts which either require time to be synced or which log meaningful activities for record purposes [like disk-check].I would be very much against an across the board approach that would impact everyone. If your system needs time as quickly as possible, there are relatively easy ways to achieve this. The easiest is to set up a system as a time server (with a static IP) and put a loop in init-start to continuously query the IP of that system until the LAN comes up, then get the time and set ntp_ready. I have a raspberry pi I use for a time server (it gets GPS time), and it gets time within 2 seconds of being started. I'm pretty sure the LAN comes up before the WAN, and certainly before DNS, so using a time server internal to your network is the very fastest way to get time. I'll put a script up in Gist of what I use.
Some have elaborate setups with GPS receivers attached to the router to get (more) accurate time.I guess its good for a message to the log !!
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!