How to disable NTP synchronization and set hwclock to UTC

Post here if you are a new Porteus member and you're looking for some help.
baloontravel
White ninja
White ninja
Posts: 20
Joined: 29 Mar 2023, 16:12
Distribution: Voidlinux, Poerteus

How to disable NTP synchronization and set hwclock to UTC

Post#1 by baloontravel » 03 Oct 2023, 15:42

1) I want to have hwclock set to UTC and
2) system clock to localtime

I commented local time from porteus.cfg.
Linked time zone to /etc/localtime.

/mnt/sdb1/porteus/changes/etc/hardwareclock is set to UTC
but after boot something :starwars: changes /etc/hardwareclock to localetime

I also want to disable NTP synchronization.
Last edited by baloontravel on 03 Oct 2023, 16:03, edited 1 time in total.

User avatar
Blaze
DEV Team
DEV Team
Posts: 3885
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus current ☯ all DEs ☯
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

How to disable NTP synchronization and set hwclock to UTC

Post#2 by Blaze » 03 Oct 2023, 15:56

Hi baloontravel,
how about open terminal and run:

Code: Select all

su
toor
cp /etc/localtime{,.bak} && rm /etc/localtime && ln -sf /usr/share/zoneinfo/UTC /etc/localtime && ntpdate pool.ntp.org && hwclock -lw
?
Linux 6.6.11-porteus #1 SMP PREEMPT_DYNAMIC Sun Jan 14 12:07:37 MSK 2024 x86_64 Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Navi 23 [Radeon RX 6600] [1002:73ff] (rev c7) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

How to disable NTP synchronization and set hwclock to UTC

Post#3 by Ed_P » 03 Oct 2023, 16:13

Ed

baloontravel
White ninja
White ninja
Posts: 20
Joined: 29 Mar 2023, 16:12
Distribution: Voidlinux, Poerteus

How to disable NTP synchronization and set hwclock to UTC

Post#4 by baloontravel » 03 Oct 2023, 17:40

I executed commands with linking localetime to zoneinfo/UTC.
Did dump-session to save changes.
All clocks were set to UTC at this point.

But after reboot still hwclock and date shows my local time.

Is there any way to prevent system from changing hwclock?

baloontravel
White ninja
White ninja
Posts: 20
Joined: 29 Mar 2023, 16:12
Distribution: Voidlinux, Poerteus

How to disable NTP synchronization and set hwclock to UTC

Post#5 by baloontravel » 04 Oct 2023, 09:45

I used barbaric solution and just replaced ntpdate with empty script.

Post Reply