Bug#918190: systemd: timesyncd stopped updating clock file after package update

Patrick Häcker pat_h at web.de
Fri Jan 4 08:49:59 GMT 2019


Hi,

the problem seems to be mixing two approaches in an incompatible way:

1) /var/lib/systemd/timesync can either be a directory (a) or a symlink to
/var/lib/private/systemd/timesync (b)

2) systemd-timesyncd.service may either contain DynamicUser=yes (a) or not 
(b).

1a together with 2b should work as should 1b together with 2a.

With systemd 240-2 the combination 1b-2b seems to be used, which cannot work.

I just tested both combinations 1a-2b and 1b-2a and they work both.

But which package created the symlink (i.e. the transition from 1a to ab)? 
According to the symlink's timestamp (do not confuse with the clock's 
timestamp) and dpkg's log this was due to the upgrade from systemd version 
232-25+deb9u6 to 239-15.

So I guess the least intrusive change is to have systemd change /var/lib/
systemd/timesync back to being a directory. This only breaks if a user 
manually switched to DynamicUser, so it might be worth mentioning in the 
changelog.

Kind regards
Patrick

On Fri, 04 Jan 2019 07:27:05 +0100 =?utf-8?q?Patrick_H=C3=A4cker?= 
<pat_h at web.de> wrote:
> Package: systemd
> Version: 240-2
> Severity: normal
> 
> Dear Maintainer,
> 
> after updating systemd from 239-15 to 240-2 timesyncd stopped touching
> /var/lib/private/systemd/timesync/clock any more and its time stamps
> stay at the time of the package upgrade.
> Additionally the file is no longer used to update the system time after
> reboot, using the compile time instead until an NTP server is available
> (if no RTC is available).
> 
> This is reproducable for the two systems I tested (the other is on amd64).
> On both systems the last timestamp is the time of the package upgrade
> according to the dpkg log.
> Downgrading to 239-15 solves the issue and the file is updated again.
> 
> Using
> > systemd.log_level=debug systemd.log_target=kmsg log_buf_len=1M 
printk.devkmsg=on
> as linux command line boot parameter, the following error appears in the 
log:
> > systemd-timesyncd[309]: Failed to create state directory, ignoring: 
Permission denied
> 
> So the open of /var/lib/systemd/timesync in timesyncd.c, line 37, fails. The
> reason is probably
> > ls -ld /var/lib/private
> > drwx------ 3 root root 4096 Dez 20 16:03 /var/lib/private/
> as timesyncd runs with UID/GUI systemd-timesync:systemd-timesync.
> 
> The following article might be related (modulo all the noise):
> https://utcc.utoronto.ca/~cks/space/blog/linux/SystemdTimesyncdFailure
> 
> Kind regards
> Patrick
> 
> 
> -- Package-specific info:
> 
> -- System Information:
> Debian Release: buster/sid
>   APT prefers testing
>   APT policy: (800, 'testing'), (700, 'stable'), (500, 'stable-updates')
> Architecture: armhf (armv7l)
> 
> Kernel: Linux 4.19.8-v7+ (SMP w/4 CPU cores)
> Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), 
LANGUAGE=de_DE.UTF-8 (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: systemd (via /run/systemd/system)
> 
> Versions of packages systemd depends on:
> ii  adduser          3.118
> ii  libacl1          2.2.52-3+b1
> ii  libapparmor1     2.13.1-3+b1
> ii  libaudit1        1:2.8.4-2
> ii  libblkid1        2.33-0.2
> ii  libc6            2.28-2
> ii  libcap2          1:2.25-1.2
> ii  libcryptsetup12  2:2.0.6-1
> ii  libgcrypt20      1.8.4-4
> ii  libgnutls30      3.6.5-2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://alioth-lists.debian.net/pipermail/pkg-systemd-maintainers/attachments/20190104/3d268a81/attachment-0001.sig>


More information about the Pkg-systemd-maintainers mailing list