[systemd-devel] DynamicUser in instantiated (and socket-activated) units
Leonid Isaev
leonid.isaev at ifax.com
Tue Jan 21 16:20:43 UTC 2020
On Tue, Jan 21, 2020 at 05:08:14PM +0100, Lennart Poettering wrote:
> if you speciy the same user name its going to have the same uid.
>
> use something like this:
>
> ...
> [Service]
> ...
> User=foo-%i
> DynamicUser=1
> ...
>
> That way you have a separate user for each instance, and the user is
> called "foo-" suffixed with the instance ID. And each UID is
> dynamically assigned.
Great, it works, thanks!
I see, so without a User= line, username is the same as the unit name (before
@)... apparently I didn't read systemd.exec manpage carefully enough.
Sincerely,
L.
--
Leonid Isaev
More information about the systemd-devel
mailing list