Consider creating and making the _daemon_ user available before running any steps
merkata opened this issue · comments
What needs to get done
I see currently the daemon user is created after all steps for all parts are done and the home dir is PEBBLE_PATH (and that user does not have access to it).
It would be beneficial to bootstrap that user in advance, so before all steps rather than after all the steps and make that user available.
Why it needs to get done
That would play nicely with translating Dockerfiles to rockcraft files, things like su user -c "funky bash stuff" would just work. Now you have to do the funky stuff as root and then chown with UID/GID of daemon.
For the second part of having a non-writable home directory, I was hoping the daemon user could get something that it calls home and can write to it. I'm explicitly overriding a prime step and adjusting permissions per sub-directory (I don't want to change ownership of PEBBLE_PATH, so I chown PEBBLE_PATH/.local, PEBBLE_PATH/.config etc.). In general you wouldn't want to write something in your home at runtime and refer to it I guess, though still living under PEBBLE_PATH feels weird to me.