canonical / core18

The core18 base snap
14 stars 26 forks source link

Clean up the leftover timesync directory on startup, if present #7

Closed sil2100 closed 6 years ago

sil2100 commented 6 years ago

This is needed to make sure systemd-timesyncd will be able to start with dynamic users. Currently /lib/systemd/system is writable so we need to do that on boot - useful for cases of upgrading from older core18 systems. Might not be necessary in the end, but good to have it now.

sil2100 commented 6 years ago

We're adding the ExecStartPost to systemd-tmpfiles-setup instead of systemd-timesyncd because the latter won't even start executing any scripts without the ability to use dynamic users (which is what we're trying to fix). So I decided on doing it for one of the services that are meant to be run before timesyncd. I was bikesheding here a bit, with first adding a separate oneshot service that will do the same, but since it's just a quick hack I thought the less things we need to touch the better.