Search code examples
linuxdebianutcreal-time-clockdebian-jessie

Unable to set the mode of the realtime clock to UTC


On my Debian (Jessie) Linux machine I would like to set the mode of the realtime clock to UTC as recommended by the timedatectl command (see below). But this doesn't seem to work properly.

Execution of the timedatectl command which is part of the systemd-timesyncd daemon concept, results in the following warning:

Warning: The system is configured to read the RTC time in the local time zone. This mode can not be fully supported. It will create various problems with time zone changes and daylight saving time adjustments. The RTC time is never updated, it relies on external facilities to maintain it. If at all possible, use RTC in UTC by calling 'timedatectl set-local-rtc 0'.

Submitting the suggested command:

timedatectl set-local-rtc 0

results in the following error:

Failed to set local RTC: Failed to set RTC to local/UTC: Input/output error

When immediately submitting the same command a second time, there is no error and the UTC warning from above is gone. But unfortunately this is reverting back after 1-2 min.! That means that when waiting some minutes and then executing timedatectl again, the warning is back!!

REMARK: I'm working on a regular Linux machine which has an RTC clock (not an embedded system)!


Solution

  • Very tricky!

    As stated in the documentation, setting the RTC mode with:

    timedatectl set-local-rtc 0

    modifies the third line in /etc/adjtime. It turned out that this file on my machine only had two lines! In this case the command is NOT capable of writing the change!!! This is really a joke! The third line MUST exist! So since I've added "UTC" in the third line, I'm now able to switch the content of this line with the command above ... 0 or ... 1. Accordingly the warning is gone and does not return!