Parental Control times not DST aware?

I have 19.07.4 on Archer C7.

Several Traffic Rules in the Firewall are configured to prevent my child from using a specific computer during certain times. This has worked perfectly for months, but after the time change due to DST it appears this is occurring an hour later. I had to disable that rule temporarily until I figure out what's going on.

This should be straightforward for someone familiar with this but I'm not! If it helps, I'm using the America/Chicago timezone.

The only other option in Luci is to use UTC, but that's not going to compensate for DST.

1 Like

did the router change it's time accordingly ?

Forgot to mention that. Yes, interestingly the time is correct on the Status page.

Looks like the same problem or at least very similar:
Firewall time restrictions time change issue

I did find that post earlier, but there doesn't seem to be any real solution other than rebooting, if I'm interpreting this correctly. Does it actually have to be rebooted any time DST goes into or out of effect?

1 Like

You might try with hwclock -u --systz, which is how the kernel clock is initialised at a reboot (in the current master since February: https://github.com/openwrt/openwrt/commit/157cd0bd97bcfec8a34d4ebb558f37bee4f0515f

(earlier OpenWrt versions use busybox OpenWrt tweak: busybox date -k

2 Likes

So would this go in rc.local? Would you recommend running this command first to see if it fixes it, then putting the command in rc.local so it runs at reboot?

It's part of the system service, so a universal method can be restarting the service on schedule:
https://openwrt.org/docs/guide-user/base-system/system_configuration#daylight_saving_time

For Gargoyle, we have a utility which runs a similar process to the new hwclock -u --systz. We run this on a cron job every 10 minutes to ensure that DST changes are caught and kerneltz is updated.
I'm surprised a similar mechanism isn't in OpenWrt?

Running this manually seemed to fix it, so I set up a cron job to run

date -k

at 04:00 each day, which would be well after DST changes but still early in the day.

1 Like

DST changes happen 2 times per year at pre-determined times. Any specific reason why you set it to run on every day during the whole year? It should be enough to run for a few days in March/April and October/November so that the possible annual variation in the exact date would be taken care of.

(and naturally the "every 10 minutes" for Gargoyle sounds really weird if DST change is the reason :wink: )

or only once a week, since it always (in EU) happens the night of sat-sun.

Because I was lazy :slight_smile:

I don't have to think about it much and it has essentially no impact on the operation of the router.

1 Like

It covers system time in general as well. If someone changes timezone settings etc.
It probably runs more frequently than it has to, but it finishes almost instantly so no problems.

This should reload/restart the system service which includes the discussed command.

I used the following:

opkg update
opkg install at

at 0300 nov 7 2021
at> /etc/init.d/system restart
at> <EOT>

Press CTRL-D on the second line for EOT
i guess you just have to remember to reinstall atd after an update, if any before nov 7
can also use command atq to see what is currently scheduled or go to /tmp/spool/cron/atjobs

will see what happens in november...

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.