Post-DST and MSR not reflecting local time
-
@gwp1 said in Post-DST and MSR not reflecting local time:
doing a .../diag/sun and it shows me:
The host time is 3/10/2024, 8:04:48 AM offset -300 minutes from UTC (TZ=undefined;
Try setting TZ. If using
systemctl, do it in the systemctl configuration for Reactor.No startup logs? No nodejs version info?
Traveling, have limited access.
@toggledbits according to a screenshot in the first post, the RPi does have a default timezone. It's America/New York.
NodeJS v18.18.2
Pleading ignorance here for "If using
systemctldo it in the systemctl configuration for Reactor. Not sure what you mean by that.I've restarted Reactor and pulled two log files. I'll put them in the Dropbox.
-
@toggledbits according to a screenshot in the first post, the RPi does have a default timezone. It's America/New York.
NodeJS v18.18.2
Pleading ignorance here for "If using
systemctldo it in the systemctl configuration for Reactor. Not sure what you mean by that.I've restarted Reactor and pulled two log files. I'll put them in the Dropbox.
@gwp1 set tz in your environment for nodejs
-
@gwp1 set tz in your environment for nodejs
@toggledbits So this is new territory for me. What appears to have resolved this is the addition to
app.jsof this line at the top:process.env.TZ = "America/New_York";I placed it here:
/** Copyright (C) 2020-2023 Kedron Holdings LLC, All Rights Reserved. This file is part of Reactor. * For info and license terms please see https://reactor.toggledbits.com/ * ------------------------------------------------------------------------------ */ process.env.TZ = "America/New_York"; const a0_0x2a8642 = a0_0x2074; -
@toggledbits So this is new territory for me. What appears to have resolved this is the addition to
app.jsof this line at the top:process.env.TZ = "America/New_York";I placed it here:
/** Copyright (C) 2020-2023 Kedron Holdings LLC, All Rights Reserved. This file is part of Reactor. * For info and license terms please see https://reactor.toggledbits.com/ * ------------------------------------------------------------------------------ */ process.env.TZ = "America/New_York"; const a0_0x2a8642 = a0_0x2074;@gwp1 said in Post-DST and MSR not reflecting local time:
So this is new territory for me.
OK. I'm back home now and can engage this a little more.
First, what you've done may have worked, but it's not the "right" way and nobody should ever do this in future. I say that only to avoid people going down this path if they happen upon this thread later. This may have worked, but you're going to have to redo it every time you upgrade Reactor, and it's just generally not the OS-approved way to handle it.
To start on the "right" path, we need to begin with a look at your system time setting, which you can see by doing the following (post the output here in reply):
ls -l /etc/localtimeThe named path is (or should be) a symbolic link to a timezone data file (typically in
/usr/share/zoneinfo). The preferred timezone names these days are continental/regional forms, likeAmerica/New_York, not the oldEST5EDTform. Using thetimedatectlcommand with no options should show the correct current time, time zone, offset, and NTP status.If Reactor is still misbehaving, make sure your OS is fully up to date, and all timezone data files have been updated to latest versions. If updates were applied, reboot and repeat the checks in the previous paragraph.
If all that doesn't fix or change it...
THIS APPLIES TO BARE-BONES INSTALLS ONLY. If you're a docker user having time zone or DST issues, see here.
The best way to change it on an RPi is to the
raspi-configapplication. You can also manually symbolically relink the file yourself (i.e.in -sf /usr/share/zoneinfo/whatever/whatever /etc/localtimeand then use thelscommand again to confirm the result). Reboot the system after changing the time zone. Here's some helpful into for Ubuntu and Debian users on other hardware.I have never run into a system bare-bones install that requires TZ to be set if the system time zone is set by linking
/etc/localtimecorrectly. Common problems are misspelled time zone names (like apparently @Tom_D ran into). Docker users must set TZ in the container configuration, but should use the same continental/regional forms.From there, if your nodejs is still not providing proper time to Reactor, you have some other misconfiguration or possibly nodejs bug (although I see no issues on 18 or 20) that I'm not going to spend time digging for -- you can set TZ for the Reactor process to work around it, but we need to know how you are starting up Reactor. If you used my RPi install script (from the
reactor/toolsdirectory), then you are usingsystemctl, because that's what the script sets up. To set TZ in the configuration forsystemctl, do the following as root:-
Open
/etc/systemd/system/reactor.servicein your favorite editor (nano,vi, etc.) -
Find the line beginning
Environment -
Insert the following additional line after that (change the timezone specifier as needed for your locale):
Environment=TZ=America/New_YorkYou should now have two lines that begin with
Environment-- one forNODE_PATHand one forTZ. -
Save the modified file.
-
Run
systemctl daemon-reloadto reload the modified config file. -
Run
systemctl restart reactorto restart the Reactor service.
That should address the timezone configuration when running Reactor with
systemctl. If you start Reactor some other way (and again, this applies to bare-bones installs only, not docker), the easiest thing to do is to make the TZ environment variable setting part of the system startup process. Do this (as root) only if not usingsystemctlto start/run Reactor:-
Open
/etc/profilein your favorite editor; -
At the bottom, add this line (change the timezone spec to whatever yours is):
TZ=America/New_York ; export TZ -
Save the file.
-
Reboot the system.
-
Log in and confirm the environment setting by doing
echo $TZ
-
-
@gwp1 said in Post-DST and MSR not reflecting local time:
So this is new territory for me.
OK. I'm back home now and can engage this a little more.
First, what you've done may have worked, but it's not the "right" way and nobody should ever do this in future. I say that only to avoid people going down this path if they happen upon this thread later. This may have worked, but you're going to have to redo it every time you upgrade Reactor, and it's just generally not the OS-approved way to handle it.
To start on the "right" path, we need to begin with a look at your system time setting, which you can see by doing the following (post the output here in reply):
ls -l /etc/localtimeThe named path is (or should be) a symbolic link to a timezone data file (typically in
/usr/share/zoneinfo). The preferred timezone names these days are continental/regional forms, likeAmerica/New_York, not the oldEST5EDTform. Using thetimedatectlcommand with no options should show the correct current time, time zone, offset, and NTP status.If Reactor is still misbehaving, make sure your OS is fully up to date, and all timezone data files have been updated to latest versions. If updates were applied, reboot and repeat the checks in the previous paragraph.
If all that doesn't fix or change it...
THIS APPLIES TO BARE-BONES INSTALLS ONLY. If you're a docker user having time zone or DST issues, see here.
The best way to change it on an RPi is to the
raspi-configapplication. You can also manually symbolically relink the file yourself (i.e.in -sf /usr/share/zoneinfo/whatever/whatever /etc/localtimeand then use thelscommand again to confirm the result). Reboot the system after changing the time zone. Here's some helpful into for Ubuntu and Debian users on other hardware.I have never run into a system bare-bones install that requires TZ to be set if the system time zone is set by linking
/etc/localtimecorrectly. Common problems are misspelled time zone names (like apparently @Tom_D ran into). Docker users must set TZ in the container configuration, but should use the same continental/regional forms.From there, if your nodejs is still not providing proper time to Reactor, you have some other misconfiguration or possibly nodejs bug (although I see no issues on 18 or 20) that I'm not going to spend time digging for -- you can set TZ for the Reactor process to work around it, but we need to know how you are starting up Reactor. If you used my RPi install script (from the
reactor/toolsdirectory), then you are usingsystemctl, because that's what the script sets up. To set TZ in the configuration forsystemctl, do the following as root:-
Open
/etc/systemd/system/reactor.servicein your favorite editor (nano,vi, etc.) -
Find the line beginning
Environment -
Insert the following additional line after that (change the timezone specifier as needed for your locale):
Environment=TZ=America/New_YorkYou should now have two lines that begin with
Environment-- one forNODE_PATHand one forTZ. -
Save the modified file.
-
Run
systemctl daemon-reloadto reload the modified config file. -
Run
systemctl restart reactorto restart the Reactor service.
That should address the timezone configuration when running Reactor with
systemctl. If you start Reactor some other way (and again, this applies to bare-bones installs only, not docker), the easiest thing to do is to make the TZ environment variable setting part of the system startup process. Do this (as root) only if not usingsystemctlto start/run Reactor:-
Open
/etc/profilein your favorite editor; -
At the bottom, add this line (change the timezone spec to whatever yours is):
TZ=America/New_York ; export TZ -
Save the file.
-
Reboot the system.
-
Log in and confirm the environment setting by doing
echo $TZ
@toggledbits I left this as unsolved because I was questioning my workaround for the exact reason you state: what about future updates overwriting what I'd done?
Results of
ls -l /etc/local/timeSo something is clearly amiss.
Moving on,
timedatectlshows what I would expect. This information is correct:Moving on... I've done this before but stepped thru it again just to be sure.
sudo raspi-configRebooted.
Alas, same result for
ls -l /etc/local/timeMoving on...
Moving on...
Did
in -sf /usr/share/zoneinfo/whatever/whatever /etc/localtimewhich I think should beln -sf /usr/share/zoneinfo/whatever/whatever /etc/localtimeand rebooted.Oddly, no change. Went digging into the RPi and realized
ls -l /etc/local/timeshould be
ls -l /etc/localtimeThe result of that is
...which is what I'd expect and want.Moving on...
Removed
process.env.TZ = "America/New_York";from
app.jsand restarted Reactor. Right back where we started.

Moving on to the
reactor.serviceedit. This resulted in:

A few seconds off which netted me the MSR warning but I'll make sure both sides are properly synced NTP-wise.
Actually, they took care of each other themselves - btt I saved the edits here everything was back to normal.

-
-
@toggledbits I left this as unsolved because I was questioning my workaround for the exact reason you state: what about future updates overwriting what I'd done?
Results of
ls -l /etc/local/timeSo something is clearly amiss.
Moving on,
timedatectlshows what I would expect. This information is correct:Moving on... I've done this before but stepped thru it again just to be sure.
sudo raspi-configRebooted.
Alas, same result for
ls -l /etc/local/timeMoving on...
Moving on...
Did
in -sf /usr/share/zoneinfo/whatever/whatever /etc/localtimewhich I think should beln -sf /usr/share/zoneinfo/whatever/whatever /etc/localtimeand rebooted.Oddly, no change. Went digging into the RPi and realized
ls -l /etc/local/timeshould be
ls -l /etc/localtimeThe result of that is
...which is what I'd expect and want.Moving on...
Removed
process.env.TZ = "America/New_York";from
app.jsand restarted Reactor. Right back where we started.

Moving on to the
reactor.serviceedit. This resulted in:

A few seconds off which netted me the MSR warning but I'll make sure both sides are properly synced NTP-wise.
Actually, they took care of each other themselves - btt I saved the edits here everything was back to normal.

@gwp1 said in Post-DST and MSR not reflecting local time:
Results of
ls -l /etc/local/time
Ugh! That's a typo (one of two) on my part (
localtimeshould be one word without a slash in it). I'll correct the original post, but as you discovered later, it should be:ls -l /etc/localtimeThanks for picking those errors up.
It's pretty unusual to have to set TZ for a
systemdprocess. Again, I think there's some lurking broken config somewhere in the OS. But if setting TZ in thesystemdconfig fixes it, that works.What OS are you using? Can you post the contents of
/etc/issue? -
@gwp1 said in Post-DST and MSR not reflecting local time:
Results of
ls -l /etc/local/time
Ugh! That's a typo (one of two) on my part (
localtimeshould be one word without a slash in it). I'll correct the original post, but as you discovered later, it should be:ls -l /etc/localtimeThanks for picking those errors up.
It's pretty unusual to have to set TZ for a
systemdprocess. Again, I think there's some lurking broken config somewhere in the OS. But if setting TZ in thesystemdconfig fixes it, that works.What OS are you using? Can you post the contents of
/etc/issue? -
OK. I don't have that running in my environment any more. It's EOL in June as well. You may want to plan for an upgrade. Not saying it's related; I've been through plenty of DSTs on Buster when I was using it, without issue. But like everything else, it's in your interest long-term to follow along with the LTS cycles, at least.
-
OK. I don't have that running in my environment any more. It's EOL in June as well. You may want to plan for an upgrade. Not saying it's related; I've been through plenty of DSTs on Buster when I was using it, without issue. But like everything else, it's in your interest long-term to follow along with the LTS cycles, at least.
@toggledbits yeah, I just got new hardware and am considering moving to the containerized version. But that's going to take some time as it's tech I've not played with before and my day job + new puppy haven't left much dev hours these months.

MSR is now very integral to the operation of this house so I need to tread carefully when poking the proverbial bear.
-
T toggledbits locked this topic on



















