[Solved] Prevent setting hardware clock on shutdown/restart

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
captainmorgan
Level 1
Level 1
Posts: 27
Joined: Thu May 03, 2012 9:28 am
Location: USA
Contact:

[Solved] Prevent setting hardware clock on shutdown/restart

Post by captainmorgan »

I've got a PXE setup running Linux Mint Sylvia. Often, we boot this on machines running Windows. In the past (e.g., with Qiana) we haven't had any problem with time after setting the Linux to use localtime instead of UTC, but Sylvia still seems to be setting the hardware clock in a way that makes the time wrong in Windows.

Now, I don't actually care about getting Linux to set the correct time, so I wanted to simply disable setting the hardware clock at all. I've removed the links to hwclock.sh in /etc/rc.0 and /etc/rc.6. That didn't work. I even renamed the hwclock executable. That still didn't work, so I assume something is using another method to set the hardware clock. Does anyone know what it is and the proper way to disable it?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 3 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
John 3:3
User avatar
trytip
Level 14
Level 14
Posts: 5367
Joined: Tue Jul 05, 2016 1:20 pm

Re: Prevent setting hardware clock on shutdown/restart

Post by trytip »

/etc/rc.0 and /etc/rc.6 doesn't work for ubuntu 18 if i remember thing correctly

timedatectl status
timedatectl set-local-rtc 1 <<< set to local time (i don't like the way linux does this and keeps complaining that my time is local and i need to switch to UTC :twisted:
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'.
Image
User avatar
captainmorgan
Level 1
Level 1
Posts: 27
Joined: Thu May 03, 2012 9:28 am
Location: USA
Contact:

Re: Prevent setting hardware clock on shutdown/restart

Post by captainmorgan »

Seems to have worked. Thanks! I guess I didn't realize Sylvia was on systemd; I don't mess with the startup much.
John 3:3
Locked

Return to “Other topics”