You are not logged in.

#1 2022-08-02 10:25:08

Cvlc
Member
Registered: 2020-03-26
Posts: 273

[Solved] systemd-timesyncd with Networkmanager

Hi !

My laptop doesn't adjust to local time when abroad, and I'm trying to figure out why. I am using Gnome + Networkmanager + systemd-timesyncd :

$ timedatectl status
               Local time: mar. 2022-08-02 11:49:39 CEST
           Universal time: mar. 2022-08-02 09:49:39 UTC
                 RTC time: mar. 2022-08-02 09:49:39
                Time zone: Europe/Paris (CEST, +0200)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

$ sudo systemctl status systemd-timesyncd.service
systemd-timesyncd.service - Network Time Synchronization
     Loaded: loaded (/usr/lib/systemd/system/systemd-timesyncd.service; enabled; preset: enabled)
     Active: active (running) since Tue 2022-08-02 11:49:32 CEST; 23min ago
       Docs: man:systemd-timesyncd.service(8)
   Main PID: 5012 (systemd-timesyn)
     Status: "Contacted time server 185.45.112.121:123 (0.arch.pool.ntp.org)."
      Tasks: 2 (limit: 9148)
     Memory: 1.3M
        CPU: 33ms
     CGroup: /system.slice/systemd-timesyncd.service
             └─5012 /usr/lib/systemd/systemd-timesyncd

août 02 11:49:32 systemd[1]: Starting Network Time Synchronization...
août 02 11:49:32 systemd[1]: Started Network Time Synchronization.
août 02 11:49:33 systemd-timesyncd[5012]: Contacted time server 185.45.112.121:123 (0.arch.pool.ntp.org).
août 02 11:49:33 systemd-timesyncd[5012]: Initial clock synchronization to Tue 2022-08-02 11:49:33.192579 CEST.

From the above, I gather that systemd-timesyncd uses the fallback NTP servers, and therefore doesn't receive any from the network.

Can systemd-timesyncd be made to talk to Networkmanager instead of systemd-networkd ?
Or shouldn't Gnome's geolocation services adjust the timezone ?

Not sure what is wrong here, this is the setup Ubuntu seems to be using, and I'd like to make it work without installing Chrony.

Thanks for your help !

[edit]
Geolocation seems to work, (checked in Gnome Maps) but it points to the location of the VPN provider (different from the timezone selected by timesyncd, so not the culprit)

Last edited by Cvlc (2022-10-05 17:16:43)

Offline

#2 2022-08-02 12:09:12

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [Solved] systemd-timesyncd with Networkmanager

I do think systemd-timesyncd is not the issue.

archwiki gnome page wrote:

GNOME supports automatic time zone selection (can be enabled in Date & Time section of the system settings, given that location services are enabled (see Privacy section of the settings).

Verify if that's active on your system.

Also check https://wiki.archlinux.org/title/System … eolocation .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2022-08-02 16:18:14

Cvlc
Member
Registered: 2020-03-26
Posts: 273

Re: [Solved] systemd-timesyncd with Networkmanager

Hi, thanks for your answer.

Automatic time selection is enabled in gnome settings, and from what I understand of https://wiki.archlinux.org/title/System … eolocation , Gnome doesn't require a separate API to be installed.

Offline

#4 2022-08-03 11:02:51

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [Solved] systemd-timesyncd with Networkmanager

Since the gnome timezone selection doesn't appear to work, another api may be just what you need.

For clarity :
time synchronization services like ntp & systemd-timesync do NOT change timezones .

Please post the output of

curl https://ipapi.co/timezone

Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2022-08-03 15:33:46

Cvlc
Member
Registered: 2020-03-26
Posts: 273

Re: [Solved] systemd-timesyncd with Networkmanager

For clarity :
time synchronization services like ntp & systemd-timesync do NOT change timezones .

That's what I thought, but I wasn't sure. That makes it much clearer. Unfortunately :

$ curl https://ipapi.co/timezone
curl: (7) Failed to connect to ipapi.co port 443 after 1 ms: Connection refused

not better with

$ curl https://timezoneapi.io/api/ip/?.......&token=......
[3] 4474

Last edited by Cvlc (2022-08-03 15:49:12)

Offline

#6 2022-08-04 02:18:32

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,354

Re: [Solved] systemd-timesyncd with Networkmanager

Are you using a (work?) VPN or something like that?


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

#7 2022-08-07 15:15:25

Cvlc
Member
Registered: 2020-03-26
Posts: 273

Re: [Solved] systemd-timesyncd with Networkmanager

Hi

No, but I was using TLSoDNS with a provider and that made it fail....

So

$ curl https://ipapi.co/timezone

now works. I just got back from abroad, and the time is still helplessly set to the wrong timezone !

[edit]

I added myself to the wheel group, and I think it now works. Could it be that it needs some rights to read location data ?

Last edited by Cvlc (2022-08-07 16:35:43)

Offline

#8 2022-08-10 10:27:29

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [Solved] systemd-timesyncd with Networkmanager

It's probably due to how gnome autoselect timezone tries to write new timezone .

$ ls -l /etc/localtime 
lrwxrwxrwx 1 root root 36  2 dec  2018 /etc/localtime -> /usr/share/zoneinfo/Europe/Amsterdam
$ 

That allows manually changing/setting timezone by every user.
However if gnome autoselect timezone uses timedatectl set-timezone sometimezone it does need root rights .


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#9 2022-10-05 17:16:12

Cvlc
Member
Registered: 2020-03-26
Posts: 273

Re: [Solved] systemd-timesyncd with Networkmanager

Yes, just created a new user which is not in the wheel group, and the date/time pane in settings needs unlocking with a password before use, whereas it does not (anymore) in my user session.

Thanks !

Offline

Board footer

Powered by FluxBB