[systemd-devel] systemd-timesyncd with read-only root filesystem

André Hartmann andre.hartmann at iseg-hv.de
Thu Dec 1 08:50:26 UTC 2016


Hi, I'm running systemd [1] on an embbeded Linux with
read-only filesystem. Due to missing realtime clock,
I'd like to set the clock by either NTP or by hand.

To set the time by hand with 'timedatectl set-time "time"',
NTP has to be disabled, but I cannot run 'timedatectl set-ntp false'
due to the read-only root filesystem.

If I got it right, 'timedatectl set-ntp true/false'
just creates or removes the link
/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service

I can create/remove the link by hand too, and after rebooting 
'timedatectl status' says NTP enabled or disabled.

So I naively created the following link structure (which works):

/etc/systemd/system/sysinit.target.wants/systemd-timesyncd.service ->
/mnt/writeable/systemd-timesyncd ->
/lib/systemd/system/systemd-timesyncd.service

But if I remove /mnt/writeable/systemd-timesyncd and reboot,
the command 'timedatectl status' still reports enabled, which is 
unexpected.

Do you have any hints or recommendations on this?

Thanks and best regards,
Andre

[1] systemd 219
+PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP
-LIBCRYPTSETUP -GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID
-ELFUTILS +KMOD +IDN


More information about the systemd-devel mailing list