NTP service allways changes to inactive

Hello,

I got following issue. My openhab loses the NTP synchronization. I have NTP binding installed and configured.

On commandline I active NTP via:
sudo timedatectl set-ntp true

Afterwards via timedatectl the clock is synchronized, but after a few hours the clocked is unsynchronized and the status changes to inactive.

In /etc/system/timesyncd.conf the same NTP server is configured as in the NTP binding in OH.

Do have a idea what I can change that the my PI stays synchronized?

HW: Rasp Pi 3B+
OH Version: OH 3.2.0 Release Build

What is the output of

sudo systemctl status systemd-timesyncd

when the time is not synchronized any longer ?

Hi Wolfgang,

the service seems to stopped at somepoint. Here is the output:

systemd-timesyncd.service - Network Time Synchronization
   Loaded: loaded (/lib/systemd/system/systemd-timesyncd.service; enabled; vendor preset: enabled)
  Drop-In: /usr/lib/systemd/system/systemd-timesyncd.service.d
           └─disable-with-time-daemon.conf
   Active: failed (Result: start-limit-hit) since Tue 2022-06-21 03:05:57 CEST; 4h 17min ago
     Docs: man:systemd-timesyncd.service(8)
  Process: 1658 ExecStart=/lib/systemd/systemd-timesyncd (code=exited, status=0/SUCCESS)
 Main PID: 1658 (code=exited, status=0/SUCCESS)
   Status: "Shutting down..."

Jun 21 03:05:56 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 03:05:56 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 03:05:56 openhab3 systemd-timesyncd[1658]: Synchronized to time server for the first time Jun 21 03:05:57 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 03:05:57 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 03:05:57 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 03:05:57 openhab3 systemd[1]: systemd-timesyncd.service: Start request repeated too quickly.
Jun 21 03:05:57 openhab3 systemd[1]: systemd-timesyncd.service: Failed with result 'start-limit-hit'.
Jun 21 03:05:57 openhab3 systemd[1]: Failed to start Network Time Synchronization.

Service stopped with this message

What is the output of

sudo journalctl -u systemd-timesyncd

The output points to the same issue:

Jun 21 03:05:52 openhab3 systemd-timesyncd[1621]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 03:05:53 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 03:05:53 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 03:05:53 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 03:05:53 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 03:05:53 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 03:05:53 openhab3 systemd-timesyncd[1641]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 03:05:56 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 03:05:56 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 03:05:56 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 03:05:56 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 03:05:56 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 03:05:56 openhab3 systemd-timesyncd[1658]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 03:05:57 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 03:05:57 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 03:05:57 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 03:05:57 openhab3 systemd[1]: systemd-timesyncd.service: Start request repeated too quickly.
Jun 21 03:05:57 openhab3 systemd[1]: systemd-timesyncd.service: Failed with result 'start-limit-hit'.
Jun 21 03:05:57 openhab3 systemd[1]: Failed to start Network Time Synchronization.
Jun 21 07:26:21 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 07:26:21 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 07:26:21 openhab3 systemd-timesyncd[12984]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 07:32:55 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 07:32:55 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 07:32:55 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 07:32:55 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 07:32:55 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 07:32:55 openhab3 systemd-timesyncd[13245]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 07:32:55 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 07:32:55 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 07:32:55 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 07:32:55 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 07:32:55 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 07:32:56 openhab3 systemd-timesyncd[13264]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 07:37:58 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 07:37:58 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 07:37:58 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 07:37:58 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 07:37:58 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 07:37:58 openhab3 systemd-timesyncd[13463]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 07:37:58 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 07:37:58 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 07:37:58 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 07:37:58 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 07:37:59 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 07:37:59 openhab3 systemd-timesyncd[13482]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 07:46:37 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 07:46:37 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 07:46:37 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 07:46:37 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 07:46:37 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 07:46:37 openhab3 systemd-timesyncd[13808]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 07:46:37 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 07:46:37 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 07:46:37 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 07:46:38 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 07:46:38 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 07:46:38 openhab3 systemd-timesyncd[13828]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 07:52:58 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 07:52:58 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 07:52:58 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 07:52:58 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 07:52:58 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 07:52:58 openhab3 systemd-timesyncd[14070]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 07:52:59 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 07:52:59 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 07:52:59 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 07:52:59 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 07:52:59 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 07:52:59 openhab3 systemd-timesyncd[14089]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 08:01:21 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 08:01:21 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 08:01:21 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 08:01:21 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 08:01:21 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 08:01:21 openhab3 systemd-timesyncd[14404]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 08:01:21 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 08:01:21 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 08:01:21 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 08:01:21 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 08:01:22 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 08:01:22 openhab3 systemd-timesyncd[14425]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 08:05:59 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 08:05:59 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 08:05:59 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 08:05:59 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 08:06:00 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 08:06:00 openhab3 systemd-timesyncd[14603]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 08:06:00 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 08:06:00 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 08:06:00 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 08:06:01 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 08:06:01 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 08:06:01 openhab3 systemd-timesyncd[14623]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 08:06:03 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 08:06:03 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 08:06:03 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 08:06:03 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 08:06:04 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 08:06:04 openhab3 systemd-timesyncd[14639]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 08:06:04 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 08:06:04 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 08:06:04 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 08:06:04 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 08:06:04 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 08:06:04 openhab3 systemd-timesyncd[14658]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 08:06:07 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 08:06:07 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 08:06:07 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 08:06:07 openhab3 systemd[1]: Starting Network Time Synchronization...
Jun 21 08:06:08 openhab3 systemd[1]: Started Network Time Synchronization.
Jun 21 08:06:08 openhab3 systemd-timesyncd[14678]: Synchronized to time server for the first time [xx.xx.xx.xx]:123 (fritz.box).
Jun 21 08:06:08 openhab3 systemd[1]: Stopping Network Time Synchronization...
Jun 21 08:06:08 openhab3 systemd[1]: systemd-timesyncd.service: Succeeded.
Jun 21 08:06:08 openhab3 systemd[1]: Stopped Network Time Synchronization.
Jun 21 08:06:08 openhab3 systemd[1]: systemd-timesyncd.service: Start request repeated too quickly.
Jun 21 08:06:08 openhab3 systemd[1]: systemd-timesyncd.service: Failed with result 'start-limit-hit'.
Jun 21 08:06:08 openhab3 systemd[1]: Failed to start Network Time Synchronization.

Any idea why it failed?

Is there a directory that is called /var/lib/systemd/timesync ?

Yes the directory exist with an empty clock file

ok.
One last ( for the moment ) idea:

ls -ld /var/*/systemd/timesync/* /var/*/systemd/timesync

Here results in

drwxr-xr-x 2 systemd-timesync systemd-timesync 4096 Mar  5  2021 /var/lib/systemd/timesync
-rw-r--r-- 1 systemd-timesync systemd-timesync    0 Jun 21 21:32 /var/lib/systemd/timesync/clock
drwxr-xr-x 2 systemd-timesync systemd-timesync   60 Jun 21 17:00 /var/run/systemd/timesync
-rw-r--r-- 1 systemd-timesync systemd-timesync    0 Jun 21 21:32 /var/run/systemd/timesync/synchronized

My output:

drwxr-xr-x 2 systemd-timesync systemd-timesync 4096 Jan 11  2021 /var/lib/system                         d/timesync
-rw-r--r-- 1 systemd-timesync systemd-timesync    0 Jun 23 15:54 /var/lib/system                         d/timesync/clock

I am totally having this same issue. Was there a resolution?

1 Like

Not really it seems that whenever I connect remotely the NTP services crashes or stops. So I just start it when I connect remotely.

Seems like a bug that should be reported on GitHub. I’m happy to do it, but it looks like y’all have invested a lot of effort in troubleshooting and could probably define the problem better than I could.’

I went ahead an opened an issue on GitHub: systemd-timesyncd service fails frequently · Issue #1744 · openhab/openhabian · GitHub

Please add your observations there.

No please. GitHub isn’t there to request help with debugging, please don’t open issues unless you analyzed the issue and can prove it is a bug in some openHABian component.
(and even if it turns out to be a bug it’s unlikely to be an openHABian one as we just use the OS service so openHABian Github is likely the wrong location to address this anyway).

A quick Google search yields the following. Worth a try to adapt that to systemd-timesynd and see if it helps.

https://bugzilla.redhat.com/show_bug.cgi?id=1948042#c1

Thanks for the hint. Sorry for the GitHub - I thought there were enough of us experiencing the problem for it to be beyond what we basic users can deal with.

I looked at the link you provided. If I read it correctly (and I’m not a Linux/Debian expert at all), it is talking about problems that occur on start up (boot). That is not the case for me. It starts fine.

I can see in journalctl that the Network Time Synchronization is stopping and starting frequently:

Nov 29 12:54:18 openhab-midway.hsd1.ut.comcast.net systemd-timesyncd[20649]: Initial synchronization to time server 38.229.52.9:123 (0.debian.pool.ntp.org).
Nov 29 12:54:20 openhab-midway.hsd1.ut.comcast.net systemd[1]: Stopping Network Time Synchronization...
Nov 29 12:54:20 openhab-midway.hsd1.ut.comcast.net systemd[1]: systemd-timesyncd.service: Succeeded.
Nov 29 12:54:20 openhab-midway.hsd1.ut.comcast.net systemd[1]: Stopped Network Time Synchronization.
Nov 29 12:54:20 openhab-midway.hsd1.ut.comcast.net systemd[1]: Starting Network Time Synchronization...
Nov 29 12:54:20 openhab-midway.hsd1.ut.comcast.net systemd[1]: Started Network Time Synchronization.
Nov 29 12:54:21 openhab-midway.hsd1.ut.comcast.net systemd-timesyncd[20672]: Initial synchronization to time server 72.30.35.89:123 (0.debian.pool.ntp.org).
Nov 29 12:54:22 openhab-midway.hsd1.ut.comcast.net tailscaled[7516]: Accept: TCP{100.107.124.2:8080 > 100.65.3.2:41276} 230 tcp non-syn
Nov 29 12:54:23 openhab-midway.hsd1.ut.comcast.net systemd[1]: Stopping Network Time Synchronization...
Nov 29 12:54:23 openhab-midway.hsd1.ut.comcast.net systemd[1]: systemd-timesyncd.service: Succeeded.
Nov 29 12:54:23 openhab-midway.hsd1.ut.comcast.net systemd[1]: Stopped Network Time Synchronization.
Nov 29 12:54:23 openhab-midway.hsd1.ut.comcast.net systemd[1]: Starting Network Time Synchronization...
Nov 29 12:54:23 openhab-midway.hsd1.ut.comcast.net systemd[1]: Started Network Time Synchronization.
Nov 29 12:54:23 openhab-midway.hsd1.ut.comcast.net systemd-timesyncd[20692]: Initial synchronization to time server 45.79.111.167:123 (0.debian.pool.ntp.org).
Nov 29 12:54:26 openhab-midway.hsd1.ut.comcast.net systemd[1]: Stopping Network Time Synchronization...
Nov 29 12:54:26 openhab-midway.hsd1.ut.comcast.net systemd[1]: systemd-timesyncd.service: Succeeded.
Nov 29 12:54:26 openhab-midway.hsd1.ut.comcast.net systemd[1]: Stopped Network Time Synchronization.
Nov 29 12:54:26 openhab-midway.hsd1.ut.comcast.net systemd[1]: Starting Network Time Synchronization...
Nov 29 12:54:26 openhab-midway.hsd1.ut.comcast.net systemd[1]: Started Network Time Synchronization.
Nov 29 12:54:26 openhab-midway.hsd1.ut.comcast.net systemd-timesyncd[20711]: Initial synchronization to time server 17.253.2.123:123 (0.debian.pool.ntp.org).
Nov 29 12:54:28 openhab-midway.hsd1.ut.comcast.net systemd[1]: Stopping Network Time Synchronization...
Nov 29 12:54:28 openhab-midway.hsd1.ut.comcast.net systemd[1]: systemd-timesyncd.service: Succeeded.
Nov 29 12:54:28 openhab-midway.hsd1.ut.comcast.net systemd[1]: Stopped Network Time Synchronization.
Nov 29 12:54:28 openhab-midway.hsd1.ut.comcast.net systemd[1]: Starting Network Time Synchronization...
Nov 29 12:54:28 openhab-midway.hsd1.ut.comcast.net systemd[1]: Started Network Time Synchronization.
Nov 29 12:54:28 openhab-midway.hsd1.ut.comcast.net systemd[1]: Stopping Network Time Synchronization...
Nov 29 12:54:28 openhab-midway.hsd1.ut.comcast.net systemd[1]: systemd-timesyncd.service: Succeeded.
Nov 29 12:54:28 openhab-midway.hsd1.ut.comcast.net systemd[1]: Stopped Network Time Synchronization.
Nov 29 12:54:29 openhab-midway.hsd1.ut.comcast.net systemd[1]: Starting Network Time Synchronization...
Nov 29 12:54:29 openhab-midway.hsd1.ut.comcast.net systemd[1]: Started Network Time Synchronization.
Nov 29 12:54:29 openhab-midway.hsd1.ut.comcast.net systemd[1]: Stopping Network Time Synchronization...
Nov 29 12:54:29 openhab-midway.hsd1.ut.comcast.net systemd[1]: systemd-timesyncd.service: Succeeded.
Nov 29 12:54:29 openhab-midway.hsd1.ut.comcast.net systemd[1]: Stopped Network Time Synchronization.
Nov 29 12:54:29 openhab-midway.hsd1.ut.comcast.net systemd[1]: Starting Network Time Synchronization...
Nov 29 12:54:30 openhab-midway.hsd1.ut.comcast.net systemd[1]: Started Network Time Synchronization.
Nov 29 12:54:30 openhab-midway.hsd1.ut.comcast.net systemd-timesyncd[20772]: Initial synchronization to time server 72.30.35.89:123 (0.debian.pool.ntp.org).
Nov 29 12:54:30 openhab-midway.hsd1.ut.comcast.net systemd[1]: Stopping Network Time Synchronization...
Nov 29 12:54:30 openhab-midway.hsd1.ut.comcast.net systemd[1]: systemd-timesyncd.service: Succeeded.
Nov 29 12:54:30 openhab-midway.hsd1.ut.comcast.net systemd[1]: Stopped Network Time Synchronization.
Nov 29 12:54:30 openhab-midway.hsd1.ut.comcast.net systemd[1]: systemd-timesyncd.service: Start request repeated too quickly.
Nov 29 12:54:30 openhab-midway.hsd1.ut.comcast.net systemd[1]: systemd-timesyncd.service: Failed with result 'start-limit-hit'.
Nov 29 12:54:30 openhab-midway.hsd1.ut.comcast.net systemd[1]: Failed to start Network Time Synchronization.

I found that there are UNIT parameters StartLimitIntervalSec=interval and StartLimitBurst=burst that you can use to control the limit driven shutdown, but I’m hesitant to mess with something I don’t really understand. Is the frequent starting and stopping of the Network Time Synchronization normal?

I appreciate any suggestions for further research.

Well, it fixes a race condition of dbus and systemd-timesyncd which may have ongoing effects also long after boot. Putting this up won’t hurt.

Changing intervals won’t help.
Find out how to increase log output from timesyncd first. Add these to the systemd config file where that’s starting timesyncd. That should hopefully give you more details (in journalctl output) to analyze why it stops. That’s what you need to find out.

1 Like

Thanks for the suggestions.

I figured out how to set the systemd-timesyncd unit log level to debug from this site:
https://wiki.ubuntu.com/DebuggingSystemd

systemd-timesyncd : time synchronization issues

You can restart systemd-timesyncd in debug mode and watch for the messages for issues:

sudo systemctl stop systemd-timesyncd SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-timesyncd
The service had failed, so I started it using the debug command.

openhabian@openhab:~ $ systemctl -a --failed
  UNIT                      LOAD   ACTIVE SUB    DESCRIPTION                 
● systemd-timesyncd.service loaded failed failed Network Time Synchronization

LOAD   = Reflects whether the unit definition was properly loaded.
ACTIVE = The high-level unit activation state, i.e. generalization of SUB.
SUB    = The low-level unit activation state, values depend on unit type.

1 loaded units listed.
To show all installed unit files use 'systemctl list-unit-files'.
openhabian@openhab:~ $ SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-timesyncd
Directory "/var/lib/systemd/timesync" already exists, but is owned by 100:102 (1000:115 was requested), refusing.
Failed to create state directory, ignoring: File exists
Failed to get link NTP servers: No data available
Bus bus-api-timesync: changing state UNSET → OPENING
Bus bus-api-timesync: changing state OPENING → AUTHENTICATING
Added new server 0.debian.pool.ntp.org.
Added new server 1.debian.pool.ntp.org.
Added new server 2.debian.pool.ntp.org.
Added new server 3.debian.pool.ntp.org.
systemd-timesyncd running as pid 28087
Selected server 0.debian.pool.ntp.org.
Resolving 0.debian.pool.ntp.org...
Bus bus-api-timesync: changing state AUTHENTICATING → HELLO
Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=Hello cookie=1 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=RequestName cookie=2 reply_cookie=0 signature=su error-name=n/a error-message=n/a
Got message type=method_return sender=org.freedesktop.DBus destination=:1.1664 path=n/a interface=n/a member=n/a cookie=1 reply_cookie=1 signature=s error-name=n/a error-message=n/a
Bus bus-api-timesync: changing state HELLO → RUNNING
Got message type=signal sender=org.freedesktop.DBus.Local destination=n/a path=/org/freedesktop/DBus/Local interface=org.freedesktop.DBus.Local member=Connected cookie=4294967295 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
Got message type=signal sender=org.freedesktop.DBus destination=:1.1664 path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameAcquired cookie=2 reply_cookie=0 signature=s error-name=n/a error-message=n/a
Got message type=error sender=org.freedesktop.DBus destination=:1.1664 path=n/a interface=n/a member=n/a cookie=3 reply_cookie=2 signature=s error-name=org.freedesktop.DBus.Error.AccessDenied error-message=Connection ":1.1664" is not allowed to own the service "org.freedesktop.timesync1" due to security policies in the configuration file
Unable to request name, failing connection: Connection ":1.1664" is not allowed to own the service "org.freedesktop.timesync1" due to security policies in the configuration file
Bus bus-api-timesync: changing state RUNNING → CLOSING
Bus bus-api-timesync: changing state CLOSING → CLOSED
Resolved address 173.0.48.220:123 for 0.debian.pool.ntp.org.
Resolved address 38.229.54.9:123 for 0.debian.pool.ntp.org.
Resolved address 74.6.168.73:123 for 0.debian.pool.ntp.org.
Resolved address 64.111.99.224:123 for 0.debian.pool.ntp.org.
Selected address 173.0.48.220:123 of server 0.debian.pool.ntp.org.
Connecting to time server 173.0.48.220:123 (0.debian.pool.ntp.org).
Sent NTP request to 173.0.48.220:123 (0.debian.pool.ntp.org).
NTP response:
  leap         : 0
  version      : 4
  mode         : 4
  stratum      : 2
  precision    : 0.000000 sec (-23)
  root distance: 0.096130 sec
  reference    : n/a
  origin       : 1669860127.870
  receive      : 1669860127.961
  transmit     : 1669860127.961
  dest         : 1669860127.928
  offset       : +0.062 sec
  delay        : +0.059 sec
  packet count : 1
  jitter       : 0.000
  poll interval: 32
  adjust (slew): +0.062 sec
Failed to call clock_adjtime(): Operation not permitted
interval/delta/delay/jitter/drift 32s/+0.062s/0.059s/0.000s/+0ppm
Synchronized to time server for the first time 173.0.48.220:123 (0.debian.pool.ntp.org).
Sent NTP request to 173.0.48.220:123 (0.debian.pool.ntp.org).
NTP response:
  leap         : 0
  version      : 4
  mode         : 4
  stratum      : 2
  precision    : 0.000000 sec (-23)
  root distance: 0.096603 sec
  reference    : n/a
  origin       : 1669860159.978
  receive      : 1669860160.070
  transmit     : 1669860160.070
  dest         : 1669860160.042
  offset       : +0.061 sec
  delay        : +0.063 sec
  packet count : 2
  jitter       : 0.023
  poll interval: 32
  adjust (slew): +0.061 sec
Failed to call clock_adjtime(): Operation not permitted
interval/delta/delay/jitter/drift 32s/+0.061s/0.063s/0.023s/+0ppm
Sent NTP request to 173.0.48.220:123 (0.debian.pool.ntp.org).
NTP response:
  leap         : 0
  version      : 4
  mode         : 4
  stratum      : 2
  precision    : 0.000000 sec (-23)
  root distance: 0.097092 sec
  reference    : n/a
  origin       : 1669860192.228
  receive      : 1669860192.321
  transmit     : 1669860192.321
  dest         : 1669860192.289
  offset       : +0.062 sec
  delay        : +0.060 sec
  packet count : 3
  jitter       : 0.058
  poll interval: 32
  adjust (slew): +0.062 sec
Failed to call clock_adjtime(): Operation not permitted
interval/delta/delay/jitter/drift 32s/+0.062s/0.060s/0.058s/+0ppm
^[[1;2B

I will now investiage the “Failed to call clock_adjtime():Operation not permitted” warning.

Initial Internet searches make me think it might be permission related, but I’m not sure, and will keep digging.

I was able to eliminate some of the messages at the beginning by running as sudo:

openhabian@openhab:~ $ sudo -u systemd-timesync SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-timesyncd
Failed to get link NTP servers: No data available
Bus bus-api-timesync: changing state UNSET → OPENING
Bus bus-api-timesync: changing state OPENING → AUTHENTICATING
Added new server 0.debian.pool.ntp.org.
Added new server 1.debian.pool.ntp.org.
Added new server 2.debian.pool.ntp.org.
Added new server 3.debian.pool.ntp.org.
systemd-timesyncd running as pid 30632
Selected server 0.debian.pool.ntp.org.
Resolving 0.debian.pool.ntp.org...
Bus bus-api-timesync: changing state AUTHENTICATING → HELLO
Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=Hello cookie=1 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=RequestName cookie=2 reply_cookie=0 signature=su error-name=n/a error-message=n/a
Got message type=method_return sender=org.freedesktop.DBus destination=:1.1680 path=n/a interface=n/a member=n/a cookie=1 reply_cookie=1 signature=s error-name=n/a error-message=n/a
Bus bus-api-timesync: changing state HELLO → RUNNING
Got message type=signal sender=org.freedesktop.DBus.Local destination=n/a path=/org/freedesktop/DBus/Local interface=org.freedesktop.DBus.Local member=Connected cookie=4294967295 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
Got message type=signal sender=org.freedesktop.DBus destination=:1.1680 path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameAcquired cookie=2 reply_cookie=0 signature=s error-name=n/a error-message=n/a
Got message type=signal sender=org.freedesktop.DBus destination=:1.1680 path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameAcquired cookie=3 reply_cookie=0 signature=s error-name=n/a error-message=n/a
Got message type=method_return sender=org.freedesktop.DBus destination=:1.1680 path=n/a interface=n/a member=n/a cookie=4 reply_cookie=2 signature=u error-name=n/a error-message=n/a
Successfully acquired requested service name.
Resolved address 168.61.215.74:123 for 0.debian.pool.ntp.org.
Resolved address 69.89.207.199:123 for 0.debian.pool.ntp.org.
Resolved address 73.239.136.185:123 for 0.debian.pool.ntp.org.
Resolved address 45.55.58.103:123 for 0.debian.pool.ntp.org.
Selected address 168.61.215.74:123 of server 0.debian.pool.ntp.org.
Connecting to time server 168.61.215.74:123 (0.debian.pool.ntp.org).
Sent NTP request to 168.61.215.74:123 (0.debian.pool.ntp.org).
NTP response:
  leap         : 0
  version      : 3
  mode         : 4
  stratum      : 3
  precision    : 0.000000 sec (-23)
  root distance: 0.025322 sec
  reference    : n/a
  origin       : 1669861973.494
  receive      : 1669861973.578
  transmit     : 1669861973.578
  dest         : 1669861973.522
  offset       : +0.070 sec
  delay        : +0.028 sec
  packet count : 1
  jitter       : 0.000
  poll interval: 32
  adjust (slew): +0.070 sec
Failed to call clock_adjtime(): Operation not permitted

Still getting the Failed to call

If I use sudo w/o a -u parameter (I think this means running as root, but I’m not sure), it seems to run just fine, without the Failed to call message.

openhabian@openhab:~ $ sudo SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-timesyncd
[sudo] password for openhabian: 
Failed to get link NTP servers: No data available
Bus bus-api-timesync: changing state UNSET → OPENING
Bus bus-api-timesync: changing state OPENING → AUTHENTICATING
Added new server 0.debian.pool.ntp.org.
Added new server 1.debian.pool.ntp.org.
Added new server 2.debian.pool.ntp.org.
Added new server 3.debian.pool.ntp.org.
systemd-timesyncd running as pid 7506
Selected server 0.debian.pool.ntp.org.
Resolving 0.debian.pool.ntp.org...
Bus bus-api-timesync: changing state AUTHENTICATING → HELLO
Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=Hello cookie=1 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=RequestName cookie=2 reply_cookie=0 signature=su error-name=n/a error-message=n/a
Got message type=method_return sender=org.freedesktop.DBus destination=:1.1802 path=n/a interface=n/a member=n/a cookie=1 reply_cookie=1 signature=s error-name=n/a error-message=n/a
Bus bus-api-timesync: changing state HELLO → RUNNING
Got message type=signal sender=org.freedesktop.DBus.Local destination=n/a path=/org/freedesktop/DBus/Local interface=org.freedesktop.DBus.Local member=Connected cookie=4294967295 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
Got message type=signal sender=org.freedesktop.DBus destination=:1.1802 path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameAcquired cookie=2 reply_cookie=0 signature=s error-name=n/a error-message=n/a
Got message type=signal sender=org.freedesktop.DBus destination=:1.1802 path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameAcquired cookie=3 reply_cookie=0 signature=s error-name=n/a error-message=n/a
Got message type=method_return sender=org.freedesktop.DBus destination=:1.1802 path=n/a interface=n/a member=n/a cookie=4 reply_cookie=2 signature=u error-name=n/a error-message=n/a
Successfully acquired requested service name.
Resolved address 91.236.251.14:123 for 0.debian.pool.ntp.org.
Resolved address 212.26.18.43:123 for 0.debian.pool.ntp.org.
Resolved address 196.10.52.58:123 for 0.debian.pool.ntp.org.
Resolved address 91.209.0.17:123 for 0.debian.pool.ntp.org.
Selected address 91.236.251.14:123 of server 0.debian.pool.ntp.org.
Connecting to time server 91.236.251.14:123 (0.debian.pool.ntp.org).
Sent NTP request to 91.236.251.14:123 (0.debian.pool.ntp.org).
NTP response:
  leap         : 0
  version      : 4
  mode         : 4
  stratum      : 2
  precision    : 0.000000 sec (-22)
  root distance: 0.036522 sec
  reference    : n/a
  origin       : 1670079231.584
  receive      : 1670079230.147
  transmit     : 1670079230.147
  dest         : 1670079231.735
  offset       : -1.513 sec
  delay        : +0.151 sec
  packet count : 1
  jitter       : 0.000
  poll interval: 32
  adjust (jump): -1.513 sec
  status       : 8192 sync
  time now     : 1670079230.223
  constant     : 2
  offset       : +0.000 sec
  freq offset  : +243704 (+3 ppm)
interval/delta/delay/jitter/drift 32s/-1.513s/0.151s/0.000s/+3ppm
Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/timesync1 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=3 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a
Synchronized to time server for the first time 91.236.251.14:123 (0.debian.pool.ntp.org).
Sent NTP request to 91.236.251.14:123 (0.debian.pool.ntp.org).
NTP response:
  leap         : 0
  version      : 4
  mode         : 4
  stratum      : 2
  precision    : 0.000000 sec (-22)
  root distance: 0.037010 sec
  reference    : n/a
  origin       : 1670079262.294
  receive      : 1670079262.371
  transmit     : 1670079262.371
  dest         : 1670079262.448
  offset       : -0.000 sec
  delay        : +0.154 sec
  packet count : 2
  jitter       : 0.000
  poll interval: 64
  adjust (slew): -0.000 sec
  status       : 8193 sync
  time now     : 1670079262.448
  constant     : 2
  offset       : -0.000 sec
  freq offset  : +243704 (+3 ppm)
interval/delta/delay/jitter/drift 64s/-0.000s/0.154s/0.000s/+3ppm
Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/timesync1 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=4 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a
Sent NTP request to 91.236.251.14:123 (0.debian.pool.ntp.org).
NTP response:
  leap         : 0
  version      : 4
  mode         : 4
  stratum      : 2
  precision    : 0.000000 sec (-22)
  root distance: 0.037971 sec
  reference    : n/a
  origin       : 1670079326.544
  receive      : 1670079326.621
  transmit     : 1670079326.621
  dest         : 1670079326.699
  offset       : -0.000 sec
  delay        : +0.154 sec
  packet count : 3
  jitter       : 0.000
  poll interval: 128
  adjust (slew): -0.000 sec
  status       : 8193 sync
  time now     : 1670079326.699
  constant     : 3
  offset       : -0.000 sec
  freq offset  : +119863 (+1 ppm)
interval/delta/delay/jitter/drift 128s/-0.000s/0.154s/0.000s/+1ppm
Sent message type=signal sender=n/a destination=n/a path=/org/freedesktop/timesync1 interface=org.freedesktop.DBus.Properties member=PropertiesChanged cookie=5 reply_cookie=0 signature=sa{sv}as error-name=n/a error-message=n/a

This supports the permissions theory, I believe.

Any hints on how to give the systemd-timesync user the necessary permission would be appreciated. I will continue to study. Most of the sources I find online caution users not to change permissions if they don’t know what they are doing, which would be me.

I tried running the openhabian-config Fix Permissions utility, but I still get the failed to run message:

2022-12-03_09:05:50_CST [openHABian] Applying file permissions recommendations... OK
2022-12-03_09:06:02_CST [openHABian] Checking for default openHABian username:password combination... FAILED
2022-12-03_09:06:03_CST [openHABian] We hope you got what you came for! See you again soon ;)
openhabian@openhab:~ $ sudo -u systemd-timesync SYSTEMD_LOG_LEVEL=debug /lib/systemd/systemd-timesyncd
Failed to get link NTP servers: No data available
Bus bus-api-timesync: changing state UNSET → OPENING
Bus bus-api-timesync: changing state OPENING → AUTHENTICATING
Added new server 0.debian.pool.ntp.org.
Added new server 1.debian.pool.ntp.org.
Added new server 2.debian.pool.ntp.org.
Added new server 3.debian.pool.ntp.org.
systemd-timesyncd running as pid 10035
Selected server 0.debian.pool.ntp.org.
Resolving 0.debian.pool.ntp.org...
Bus bus-api-timesync: changing state AUTHENTICATING → HELLO
Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=Hello cookie=1 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
Sent message type=method_call sender=n/a destination=org.freedesktop.DBus path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=RequestName cookie=2 reply_cookie=0 signature=su error-name=n/a error-message=n/a
Got message type=method_return sender=org.freedesktop.DBus destination=:1.1810 path=n/a interface=n/a member=n/a cookie=1 reply_cookie=1 signature=s error-name=n/a error-message=n/a
Bus bus-api-timesync: changing state HELLO → RUNNING
Got message type=signal sender=org.freedesktop.DBus.Local destination=n/a path=/org/freedesktop/DBus/Local interface=org.freedesktop.DBus.Local member=Connected cookie=4294967295 reply_cookie=0 signature=n/a error-name=n/a error-message=n/a
Got message type=signal sender=org.freedesktop.DBus destination=:1.1810 path=/org/freedesktop/DBus interface=org.freedesktop.DBus member=NameAcquired cookie=2 reply_cookie=0 signature=s error-name=n/a error-message=n/a
Got message type=method_return sender=org.freedesktop.DBus destination=:1.1810 path=n/a interface=n/a member=n/a cookie=3 reply_cookie=2 signature=u error-name=n/a error-message=n/a
Requested service name already owned, failing connection.
Bus bus-api-timesync: changing state RUNNING → CLOSING
Bus bus-api-timesync: changing state CLOSING → CLOSED
Resolved address 50.76.34.188:123 for 0.debian.pool.ntp.org.
Resolved address 162.159.200.1:123 for 0.debian.pool.ntp.org.
Resolved address 45.55.58.103:123 for 0.debian.pool.ntp.org.
Resolved address 38.229.59.9:123 for 0.debian.pool.ntp.org.
Selected address 50.76.34.188:123 of server 0.debian.pool.ntp.org.
Connecting to time server 50.76.34.188:123 (0.debian.pool.ntp.org).
Sent NTP request to 50.76.34.188:123 (0.debian.pool.ntp.org).
NTP response:
  leap         : 0
  version      : 4
  mode         : 4
  stratum      : 1
  precision    : 0.000000 sec (-25)
  root distance: 0.000000 sec
  reference    : GPS
  origin       : 1670080031.442
  receive      : 1670080031.504
  transmit     : 1670080031.504
  dest         : 1670080031.714
  offset       : -0.074 sec
  delay        : +0.272 sec
  packet count : 1
  jitter       : 0.000
  poll interval: 32
  adjust (slew): -0.074 sec
Failed to call clock_adjtime(): Operation not permitted
interval/delta/delay/jitter/drift 32s/-0.074s/0.272s/0.000s/+0ppm
Synchronized to time server for the first time 50.76.34.188:123 (0.debian.pool.ntp.org).
Sent NTP request to 50.76.34.188:123 (0.debian.pool.ntp.org).
NTP response:
  leap         : 0
  version      : 4
  mode         : 4
  stratum      : 1
  precision    : 0.000000 sec (-25)
  root distance: 0.000000 sec
  reference    : GPS
  origin       : 1670080063.794
  receive      : 1670080063.830
  transmit     : 1670080063.830
  dest         : 1670080063.857
  offset       : +0.004 sec
  delay        : +0.063 sec
  packet count : 2
  jitter       : 0.002
  poll interval: 64
  adjust (slew): +0.004 sec
Failed to call clock_adjtime(): Operation not permitted
interval/delta/delay/jitter/drift 64s/+0.004s/0.063s/0.002s/+0ppm

This is Debian Bullseye on a Pi ?
out of curiosity what does uname -a show ?

Yes, I’m running standard openhabian on a Pi 4 B:

runtimeInfo:
  version: 3.4.0.M5
  buildString: Milestone Build
locale: en-US
systemInfo:
  configFolder: /etc/openhab
  userdataFolder: /var/lib/openhab
  logFolder: /var/log/openhab
  javaVersion: 11.0.13
  javaVendor: Azul Systems, Inc.
  javaVendorVersion: Zulu11.52+13-CA
  osName: Linux
  osVersion: 5.10.103-v7l+
  osArchitecture: arm
  availableProcessors: 4
  freeMemory: 7521016
  totalMemory: 259522560
  startLevel: 100
bindings:
  - amazonechocontrol
  - astro
  - denonmarantz
  - gpstracker
  - icalendar
  - icloud
  - ipcamera
  - irobot
  - logreader
  - mail
  - mqtt
  - myq
  - network
  - ntp
  - openweathermap
  - remoteopenhab
  - roku
  - tplinksmarthome
  - tuya
  - zwave
clientInfo:
  device:
    ios: false
    android: false
    androidChrome: false
    desktop: true
    iphone: false
    ipod: false
    ipad: false
    edge: false
    ie: false
    firefox: false
    macos: false
    windows: true
    cordova: false
    phonegap: false
    electron: false
    nwjs: false
    webView: false
    webview: false
    standalone: false
    os: windows
    pixelRatio: 1.5
    prefersColorScheme: light
  isSecureContext: false
  locationbarVisible: true
  menubarVisible: true
  navigator:
    cookieEnabled: true
    deviceMemory: N/A
    hardwareConcurrency: 4
    language: en-US
    languages:
      - en-US
    onLine: true
    platform: Win32
  screen:
    width: 1707
    height: 1067
    colorDepth: 24
  support:
    touch: false
    pointerEvents: true
    observer: true
    passiveListener: true
    gestures: false
    intersectionObserver: true
  themeOptions:
    dark: light
    filled: true
    pageTransitionAnimation: default
    bars: filled
    homeNavbar: default
    homeBackground: default
    expandableCardAnimation: default
  userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML,
    like Gecko) Chrome/107.0.0.0 Safari/537.36
timestamp: 2022-12-03T16:24:44.622Z

But to answer your specific question:

openhabian@openhab:~ $ uname -a
Linux openhab 5.10.103-v7l+ #1529 SMP Tue Mar 8 12:24:00 GMT 2022 armv7l GNU/Linux
1 Like