Hey there!
I’m currently running Ubuntu Core 18 on a Raspberry Pi 3 and noticed that many directories within the root directory are mounted read-only. I assume the core snap provides these.
Let’s say I need to run a service outside of any snap directly on the host. This service consists of a systemd service declaration in /etc/systemd/system/ and some Bash scripts stored somewhere else.
Would a refresh of the base snap (or any other snap) or any different situation overwrite these changes and “remove” the manually created service?
This question refers to the standard prebuild Ubuntu Core 18 images. The modifications mentioned above are made after the image has been flashed to a storage medium and the device has been setup.
while you should really just pack your scripts as a snap (given how trivial that is), the answer to your qustion is … it depends
writable directories in Ubuntu core are managed via
/etc/system-image/writable-paths
depending on how the writable bind mount is treated, the dirs are synced from the readonly path, are mounted as tempdirs or are permanent …
info about the diferent columns in the /etc/system-image/writable-paths file can be found at