3

When we issue "systemctl status", we usually get in the output, a line showing the status and for how long it has been in that status.

Like: (I issued that few minutes ago)

Active: active (running) since Wed 2023-11-22 01:56:06 CST; 10h ago

However, it happened to get the following line for the same service when the system time was 01:19:27 CST

Active: active (running) since Wed 2023-11-22 **01:56:06** CST; 36min **left**

Why the time after "since" is in the future? And why it shows the time "left"? Left for what?

I expected to see a time in the past and to see x time units ago

I tried to issue "systemctl list-timers --all" to find out if there is a timer related to that service, but I found none related.

4
  • "36min left" = "36min left until 01:56:06". They are using a generic function to display a relative time, and since it is supposed to be a time in the past, only "ago" is meaningful in this context. That said, what does uptime display?
    – xhienne
    Commented Nov 22, 2023 at 19:08
  • By that time, the uptime displayed: $ uptime 01:20:58 up 25 min, 3 users, load average: 0.26, 0.13, 0.14 Commented Nov 22, 2023 at 19:17
  • I'd say 36+24=60 minutes difference between the system startup and that systemctl time reference Commented Nov 22, 2023 at 19:20
  • 1
    After further digging, I found that NTP is not enabled and the machine is maintaining the RTC in the local timezone. I can see 1-hour jumps in the system messages file during reboot. Still the output of "systemctl status" was confusing and distracting. Commented Nov 22, 2023 at 20:21

1 Answer 1

4

You probably have hit this Systemd bug which occurs when your RTC is set to the local time (timedatectl will confirm this).

Either upgrade Systemd or set your RTC to UTC:

# timedatectl set-local-rtc 0

The latter is preferable. Quoting the timedatectl manual:

Note that maintaining the RTC in the local timezone is not fully supported and will create various problems with time zone changes and daylight saving adjustments. If at all possible, keep the RTC in UTC mode.

Here "problems with daylight saving adjustments" means that if your machine is off during daylight saving time change (which occured not long ago) then the time read from the RTC "will NOT be adjusted for the change" (quoted from the hwclock manual).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .