Time in logs not synchronized with hwclock/system time

My YunoHost server

Hardware: Old laptop or computer
YunoHost version: 4.2.8.3
I have access to my server : Through SSH | through the webadmin | direct access via keyboard / screen (all three!)
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : yes
If yes, please explain: Using a ynh.fr domain with dynamic DNS managed by Yunohost

Description of my issue

Question: Is it typical for the time in Yunohost logs to be UTC time, no matter what time the hardware clock and system time on the server are set to? I live in UTC -4 time zone.
Details:

  1. Yesterday I set my server’s hardware clock to local time; for confirmation, here is the output of cat /etc/adjtime:
    0.000000 1631775601 0.000000
    1631775601
    LOCAL
  2. I confirmed that the system (OS) time was correct using this command: date
  3. I synchronized my hardware clock to the system time using: sudo hwclock --systohc
  4. I confirmed that the hardware clock time was correct using: sudo hwclock --verbose
  5. I modified the crontab file using: sudo nano /etc/crontab
  6. I added the following lines to the crontab file:
    0 3 * * * root /sbin/hwclock --systohc # set hardware clock to system clock time each day at 03:00 am
    1 3 * * * root /sbin/shutdown -r now “daily reboot” # reboot every day at 03:01 am

Yet here are the first few lines of one of the system logs from today (Fail2Ban journalctl):

-- Logs begin at Thu 2021-09-16 03:04:03 EDT, end at Thu 2021-09-16 14:16:52 EDT. --
Sep 16 07:02:04 systemd[1]: Starting Fail2Ban Service...
Sep 16 07:02:05 systemd[1]: Started Fail2Ban Service.
Sep 16 07:02:51 fail2ban-server[545]: Server ready

It looks like the reboot happened at 3:01 AM local time, as desired, but the start time for Fail2Ban (and all of the other services on the Services page of the webadmin) shows as just after 7:00 AM–which would be the UTC time compared to local time.

Is this because I have a ynh.fr domain, and Yunohost (in France) manages my dynamic DNS? Or have I done something wrong in setting up the hardware clock / system time synchronization?

I think it’s related to this line: moulinette/log.py at 08f7866f7731d67f42127681cfec2f4a465644a9 · YunoHost/moulinette · GitHub

@ljf
Thank you for the link. Unfortunately, I do not understand what the code means.

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