switch /etc/systemd/system to "synced" mode #17

Merged
merged 2 commits into from Sep 8, 2017

Conversation

Projects
None yet
4 participants
Contributor

ogra1 commented Aug 31, 2017

http://manpages.ubuntu.com/manpages/xenial/man5/writable-paths.5.html

synced:
[ Any file appearing in the root filesystem will also be copied
over to writable storage. However file removals are still not
synced and files existing in both read-only and writeable
storage will not be updated. ]...

transition:
[ ...note that subsequent boots
will ignore any new files appearing or disappearing in the
original read-only rootfs location unless you perform a
factory reset. ]...

switch /etc/systemd/system to "synced" mode
http://manpages.ubuntu.com/manpages/xenial/man5/writable-paths.5.html

synced:
                 ...[Any file appearing in the root filesystem will also be copied
                 over to writable storage. However file removals are still not
                 synced  and  files  existing  in both read-only and writeable
                 storage will not be updated.]...

 transition:
                 ...[note that subsequent boots
                 will ignore any new files appearing or  disappearing  in  the
                 original  read-only  rootfs  location  unless  you  perform a
                 factory reset.]...
Contributor

zyga commented Aug 31, 2017

Why are we making this change?

Contributor

ogra1 commented Sep 1, 2017

i would have expected the PR description to be explanatory enough :)

when a new systemd unit shows up in the squashfs it will not end up in /writable (and thus stay invisible to the system) when "transition" mode is used since transition only copies the dir contents once at first mount of a device. "synced" means all files from the squashfs that do not exist at the destination get copied at every boot, so new files that get added to the squashfs will show up.

Contributor

ogra1 commented Sep 1, 2017

note that the same fix should be applied for snapcore/snapd#3807 ... the issue is identical ...

@@ -72,7 +72,7 @@
/etc/network/if-up.d auto persistent transition none
/etc/NetworkManager/system-connections auto persistent none none
# snappy security policy, etc
-/var/lib/snapd auto persistent transition none
+/var/lib/snapd auto synced none none
@zyga

zyga Sep 7, 2017

Contributor

There's an extra space here before synced

@ogra1

ogra1 Sep 7, 2017

Contributor

nope, the former "persistent" was wrongly indented (the file uses spaces for indentation) ...

@@ -109,4 +109,6 @@
/etc/default/swapfile auto persistent transition none
# allow system wide proxy setting
/etc/environment auto persistent transition none
+# https://github.com/snapcore/snapd/pull/3866
+/var/cache/snapd auto synced none none
@mvo5

mvo5 Sep 8, 2017

Contributor

Why is this synced? Will we ship things in there (probably sensibel)?

@ogra1

ogra1 Sep 8, 2017

Contributor

I dont think there will be anything in the squashfs initially ... @chipaca can probably elaborate why "synced" should be used...

@chipaca

chipaca Sep 8, 2017

Member

so that if we want to ship the caches pre-seeded, we can.

@ogra1

ogra1 Sep 8, 2017

Contributor

you are aware that caches with the same filename in both places will not be synced i assume ?
(so if you seed them later, the generated ones will stay and override)

@chipaca

chipaca Sep 8, 2017

Member

that's exactly the behaviour I want, yes, thank you.

We're leaving ourselves the option of shipping a default cache that would be used if the snapd on the device doesn't get network for a while, say. E.g. if it's only rarely online and has been updated out-of-band.

If the file exists it'll probably be fresher / better than the seeded one.

mvo5 approved these changes Sep 8, 2017

@ogra1 ogra1 merged commit 33648a2 into master Sep 8, 2017

0 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/travis-ci/push The Travis CI build could not complete due to an error
Details

@ogra1 ogra1 deleted the switch-to-synced-etc-systemd branch Sep 8, 2017

@ogra1 ogra1 restored the switch-to-synced-etc-systemd branch Sep 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment