You are not logged in.

#1 2024-07-11 08:21:26

farkaslory
Member
Registered: 2013-08-28
Posts: 11

ntpd fails at boot but start later.

I have recently updated my system and ntpd fails to start at boot

systemd gives:

# systemctl status ntpd
× ntpd.service - Network Time Service
     Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; preset: disabled)
     Active: failed (Result: exit-code) since Thu 2024-07-11 09:49:11 CEST; 24min ago
Invocation: bb4546380d1d4c289872b99429b86d7a
    Process: 795 ExecStart=/usr/bin/ntpd -g -u ntp:ntp (code=exited, status=70)

júl 11 09:49:11 Zen systemd[1]: ntpd.service: Control process exited, code=exited, status=70/SOFTWARE
júl 11 09:49:11 Zen ntpd[795]: daemon child died with signal 11
júl 11 09:49:11 Zen systemd[1]: ntpd.service: Failed with result 'exit-code'.
júl 11 09:49:11 Zen systemd[1]: Failed to start Network Time Service.
júl 11 09:49:11 Zen systemd[1]: ntpd.service: Scheduled restart job, restart counter is at 5.
júl 11 09:49:11 Zen systemd[1]: ntpd.service: Start request repeated too quickly.
júl 11 09:49:11 Zen systemd[1]: ntpd.service: Failed with result 'exit-code'.
júl 11 09:49:11 Zen systemd[1]: Failed to start Network Time Service.

relevant part of dmesg:

[    9.902144] Code: 1c 25 28 00 00 00 48 89 5d c8 48 89 fb ff 15 6d 42 04 00 44 8b 30 49 89 c5 e8 ca 5a ff ff 49 89 c4 48 85 db 0f 84 e6 00 00 00 <44> 0f b7 0b 66 41 83 f9 02 0f 84 f7 00 00 00 66 41 83 f9 0a 74 58
[   10.243782] ntpd[717]: segfault at 24 ip 000057bb7fd212d2 sp 00007fff104b93a0 error 4 in ntpd[57bb7fcbb000+7f000] likely on CPU 13 (core 5, socket 0)
[   10.243789] Code: 1c 25 28 00 00 00 48 89 5d c8 48 89 fb ff 15 6d 42 04 00 44 8b 30 49 89 c5 e8 ca 5a ff ff 49 89 c4 48 85 db 0f 84 e6 00 00 00 <44> 0f b7 0b 66 41 83 f9 02 0f 84 f7 00 00 00 66 41 83 f9 0a 74 58
[   10.650464] ntpd[750]: segfault at 24 ip 0000636f5d3d92d2 sp 00007ffea536e490 error 4 in ntpd[636f5d373000+7f000] likely on CPU 12 (core 4, socket 0)
[   10.650471] Code: 1c 25 28 00 00 00 48 89 5d c8 48 89 fb ff 15 6d 42 04 00 44 8b 30 49 89 c5 e8 ca 5a ff ff 49 89 c4 48 85 db 0f 84 e6 00 00 00 <44> 0f b7 0b 66 41 83 f9 02 0f 84 f7 00 00 00 66 41 83 f9 0a 74 58
[   11.400447] ntpd[776]: segfault at 24 ip 0000585d5ffed2d2 sp 00007ffd31f8a710 error 4 in ntpd[585d5ff87000+7f000] likely on CPU 7 (core 7, socket 0)
[   11.400454] Code: 1c 25 28 00 00 00 48 89 5d c8 48 89 fb ff 15 6d 42 04 00 44 8b 30 49 89 c5 e8 ca 5a ff ff 49 89 c4 48 85 db 0f 84 e6 00 00 00 <44> 0f b7 0b 66 41 83 f9 02 0f 84 f7 00 00 00 66 41 83 f9 0a 74 58
[   11.698264] ntpd[797]: segfault at 24 ip 00005930d16312d2 sp 00007ffdbfcb68a0 error 4 in ntpd[5930d15cb000+7f000] likely on CPU 1 (core 1, socket 0)
[   11.698272] Code: 1c 25 28 00 00 00 48 89 5d c8 48 89 fb ff 15 6d 42 04 00 44 8b 30 49 89 c5 e8 ca 5a ff ff 49 89 c4 48 85 db 0f 84 e6 00 00 00 <44> 0f b7 0b 66 41 83 f9 02 0f 84 f7 00 00 00 66 41 83 f9 0a 74 58

However If I restart the service I get:
# systemctl status ntpd
● ntpd.service - Network Time Service
     Loaded: loaded (/usr/lib/systemd/system/ntpd.service; enabled; preset: disabled)
     Active: active (running) since Thu 2024-07-11 10:17:19 CEST; 1min 10s ago
Invocation: d806203f9ce74431b6cdb18a577a83ad
   Main PID: 4289 (ntpd)
      Tasks: 2 (limit: 19068)
     Memory: 1.1M (peak: 1.8M)
        CPU: 15ms
     CGroup: /system.slice/ntpd.service
             └─4289 /usr/bin/ntpd -g -u ntp:ntp

júl 11 10:17:19 Zen ntpd[4289]: Listen and drop on 1 v4wildcard 0.0.0.0:123
júl 11 10:17:19 Zen ntpd[4289]: Listen normally on 2 lo 127.0.0.1:123
júl 11 10:17:19 Zen ntpd[4289]: Listen normally on 3 enp5s0 192.168.0.53:123
júl 11 10:17:19 Zen ntpd[4289]: Listen normally on 4 lo [::1]:123
júl 11 10:17:19 Zen ntpd[4289]: Listen normally on 5 enp5s0 [2a01:36d:111:607a:fe34:97ff:febf:ed9e]:123
júl 11 10:17:19 Zen ntpd[4289]: Listen normally on 6 enp5s0 [fe80::fe34:97ff:febf:ed9e%2]:123
júl 11 10:17:19 Zen ntpd[4289]: Listening on routing socket on fd #23 for interface updates
júl 11 10:17:19 Zen ntpd[4289]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
júl 11 10:17:19 Zen ntpd[4289]: kernel reports TIME_ERROR: 0x41: Clock Unsynchronized
júl 11 10:17:19 Zen systemd[1]: Started Network Time Service.

It is loaded but there is the "kernel reports TIME_ERROR: 0x41: Clock Unsynchronized" part.

I cannot see where could I attach coredump files...

Last edited by farkaslory (2024-07-11 08:22:42)

Offline

#2 2024-07-11 10:51:48

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,926

Re: ntpd fails at boot but start later.

please use code tags, see https://wiki.archlinux.org/title/Genera … s_and_code

The kernel TIME_ERROR is normal and just means at that point in time the clock hasn't synchronized yet.
Notice that the message appears in the same second as nptd is started ?

The reason for the fail is probably nptd starts before your network connection is ready.

Please post the output of

find /etc/systemd -type l -exec test -f {} \; -print | sort

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

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

#3 2024-07-11 11:07:57

farkaslory
Member
Registered: 2013-08-28
Posts: 11

Re: ntpd fails at boot but start later.

find /etc/systemd -type l -exec test -f {} \; -print | sort 

gives

/etc/systemd/system/bluetooth.target.wants/bluetooth.service
/etc/systemd/system/dbus-org.bluez.service
/etc/systemd/system/dbus-org.freedesktop.Avahi.service
/etc/systemd/system/display-manager.service
/etc/systemd/system/getty.target.wants/getty@tty1.service
/etc/systemd/system/multi-user.target.wants/avahi-daemon.service
/etc/systemd/system/multi-user.target.wants/cups.path
/etc/systemd/system/multi-user.target.wants/haveged.service
/etc/systemd/system/multi-user.target.wants/netctl@ethernet\x2ddhcp.service
/etc/systemd/system/multi-user.target.wants/ntpd.service
/etc/systemd/system/multi-user.target.wants/remote-fs.target
/etc/systemd/system/multi-user.target.wants/tor.service
/etc/systemd/system/printer.target.wants/cups.service
/etc/systemd/system/sockets.target.wants/avahi-daemon.socket
/etc/systemd/system/sockets.target.wants/cups.socket
/etc/systemd/system/sysinit.target.wants/debug-shell.service
/etc/systemd/system/timers.target.wants/fstrim.timer
/etc/systemd/user/default.target.wants/xdg-user-dirs-update.service
/etc/systemd/user/pipewire-session-manager.service
/etc/systemd/user/pipewire.service.wants/pipewire-media-session.service
/etc/systemd/user/sockets.target.wants/p11-kit-server.socket
/etc/systemd/user/sockets.target.wants/pipewire.socket
/etc/systemd/user/sockets.target.wants/pulseaudio.socket
 

Last edited by farkaslory (2024-09-14 15:52:24)

Offline

#4 2024-07-11 12:41:19

seth
Member
Registered: 2012-09-03
Posts: 58,698

Re: ntpd fails at boot but start later.

Please use [code][/code] tags, not "quote" tags. Edit your posts in this regard.

Replace pulseaudio w/ pipewire-pulse, haveged.service should™ no longer be necessary and then please post your complete system journal for the boot:

sudo journalctl -b | curl -F 'file=@-' 0x0.st

resp. see whether ntpd leaves behind a coredump, https://wiki.archlinux.org/title/Core_d … _core_dump

Offline

#5 2024-07-11 13:49:10

farkaslory
Member
Registered: 2013-08-28
Posts: 11

Re: ntpd fails at boot but start later.

I have disabled haveged.service switched from pulseaudio to pipewire-pulse. But no avail. I have uploaded the journalctl output. I have curedump. Should I paste the output

(gdb) thread apply all backtrace full 

here?

Last edited by farkaslory (2024-07-11 13:49:41)

Offline

#6 2024-07-11 13:53:36

seth
Member
Registered: 2012-09-03
Posts: 58,698

Re: ntpd fails at boot but start later.

I have uploaded the journalctl output. I have curedump. Should I paste the output

Where? You still have to share the link.
And yes please, post the backtrace.

Offline

#7 2024-07-11 13:57:51

wallacebw
Member
Registered: 2020-10-02
Posts: 8

Re: ntpd fails at boot but start later.

I was encountering this issue recently (NTP v4.2.8.p18-1):

I have a unique network setup where I create vNICs from a mellanox card.    I *believe* my issue was related to a race condition of the vNICs being built at the same time ntpd is starting.   

For me the fix was to edit the systemd service:

sudo systemctl edit ntpd.service

I added restart delays to the service by adding the following lines to the file:

### Editing /etc/systemd/system/ntpd.service.d/override.conf
### Anything between here and the comment below will become the contents of the drop-in file

[Service]
RestartSec=5
RestartSteps=5
RestartMaxDelaySec=600

### Edits below this comment will be discarded

You can reboot to test or manually reload the config files

sudo systemctl daemon-reload

A bit of a duct tape and bubble gum type solution, but it works for me and this is a workstation, not a server... smile

Offline

#8 2024-07-11 14:24:18

farkaslory
Member
Registered: 2013-08-28
Posts: 11

Re: ntpd fails at boot but start later.

wallacebw wrote:

I was encountering this issue recently (NTP v4.2.8.p18-1):

I have a unique network setup where I create vNICs from a mellanox card.    I *believe* my issue was related to a race condition of the vNICs being built at the same time ntpd is starting.   

For me the fix was to edit the systemd service:

sudo systemctl edit ntpd.service

I added restart delays to the service by adding the following lines to the file:

### Editing /etc/systemd/system/ntpd.service.d/override.conf
### Anything between here and the comment below will become the contents of the drop-in file

[Service]
RestartSec=5
RestartSteps=5
RestartMaxDelaySec=600

### Edits below this comment will be discarded

You can reboot to test or manually reload the config files

sudo systemctl daemon-reload

A bit of a duct tape and bubble gum type solution, but it works for me and this is a workstation, not a server... smile

The service fails to start, but it restarts clean. Thanks.

Last edited by farkaslory (2024-07-11 14:24:40)

Offline

#9 2024-09-18 17:16:18

makeworld
Member
Registered: 2019-10-24
Posts: 10

Re: ntpd fails at boot but start later.

Also had this issue. I've decided to uninstall ntp and go start and enable systemd-timesyncd.service instead.

Last edited by makeworld (2024-09-18 17:17:48)

Offline

Board footer

Powered by FluxBB