[systemd-devel] Getting timesync on RO fs

Reindl Harald h.reindl at thelounge.net
Sun Nov 5 16:13:59 UTC 2017



Am 05.11.2017 um 16:41 schrieb RĂ©mi Pincent:
> 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/lib by definition is not meant to be readonly

ReadOnlyDirectories=/
ReadWriteDirectories=-/run
ReadWriteDirectories=-/tmp
ReadWriteDirectories=-/var/lib
ReadWriteDirectories=-/var/log

or at least

ReadWriteDirectories=-/var/lib/systemd

so the answer to the question "how can i do something wrong" is "don't 
do it"


More information about the systemd-devel mailing list