[systemd-devel] Portable service and bind paths
Michael Chapman
mike at very.puzzling.org
Mon Jan 6 06:56:19 UTC 2020
On Mon, 6 Jan 2020, Claes H wrote:
> Turns out the problem was not with the mount - that was working well.
> Instead it was a user problem and I did not realize the process ran as
> root and used a different home directory.
> When I added the user homeassistant in the host and added it to the
> User= configuration in the service file it worked
> But this required the "admin" of the host to do something additional,
> it did not work "out of the box".
>
> I was thinking - how is it supposed to work with a portable service,
> which user is it recommended to run as?
> Maybe portablectl attach should create the user the service has
> declared, if it does not exist already?
> Or should is there be a general user that portable services to run as?
> Interested to hear if there is any recommendation for how a portable
> service "packager" should define the user aspect of the service
>
> Best regards
> Claes
This seems like an ideal use-case for DynamicUser=. Don't specify any
User= or Group= directly; just let systemd allocate them automatically.
More information about the systemd-devel
mailing list