[systemd-devel] Getting timesync on RO fs

Lennart Poettering lennart at poettering.net
Tue Nov 7 15:56:51 UTC 2017


On So, 05.11.17 16:41, RĂ©mi Pincent (mr.lahorde at laposte.net) wrote:

> Hello,
> 
> Since systemd 235, timesyncd stamp file has been moved to
> /var/lib/systemd/timesync/clock . As my /var partition is RO is created a
> symlink to a clock file located in a RW partition, I got this error :
> 
> /Nov 05 16:05:44 rpi-home-master systemd[12023]: systemd-timesyncd.service:
> Failed to set up special execution directory in /var/lib: Read-only file
> system//
> //Nov 05 16:05:44 rpi-home-master systemd[12023]: systemd-timesyncd.service:
> Failed at step STATE_DIRECTORY spawning /usr/lib/systemd/systemd-timesyncd:
> Read-only file system/
> 
> I've also tried to create a /var/lib/systemd/timesync symlink to a timesync folder in a RW partition. I get this error :
> 
> /Nov 05 16:37:42 rpi-home-master systemd[17668]: systemd-timesyncd.service:
> Failed to set up special execution directory in /var/lib: Not a directory//
> //Nov 05 16:37:42 rpi-home-master systemd[17668]: systemd-timesyncd.service:
> Failed at step STATE_DIRECTORY spawning /usr/lib/systemd/systemd-timesyncd:
> Not a directory/
> 
> How can I have timesyncd clock file in a separate partition?

/var is really something that should be writable. That's really how it
is defined: the writable system resources. If it's read-only for you,
then you'll be in all kinds of trouble.

That all said, systemd should probably handle this a bit more
graceful: currently, we even fail if /var/lib/systemd/timesync/ exists
already and is properly owned, when starting a service, and we should
really make this a bit more defensive: only fail if the dir doesn't
exist or is not properly owned.

That said, what you are doing isn't really supported in the first
place. Sorry. Make /var writable.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list