Normally you'd set instance-specific variables using an override file for the unit. You could easily put just 'User' and 'LimitMEMLOCK' in the override file and leave the rest of the service settings in the main unit file, with no need for an environment variable file at all. On Thu, Jun 25, 2020 at 7:24 AM Ede Wolf <listac@xxxxxxxxxxxxxxxx> wrote: > > So I have an environmentfile containing two variable definitions: > > RUNASUSER=nobody > MEM=4294967296 > > And my service section reads: > > [Service] > EnvironmentFile=/path/myfile > User=$RUNASUSER > LimitMEMLOCK=$MEM > > This service failes to startup, as I cannot seem to being able to use a > variable for the User attribute, but I may very well for LimitMEMLOCK. > > Error: > > Failed to determine user credentials: No such process > > > And if specifying instead: > > [Service] > EnvironmentFile=/path/myfile > User=nobody > LimitMEMLOCK=$MEM > > Everything does work. And I am wondering, why? And moreover, is there > any source of documentation, that lists or even explains, what > attributes may have a variable as an argument and what do not? > > As for instances/template units it would be really helpful to being able > to set the running user in the configuration/environment file. Or at > least have a knowledge of those settings, that do not allow this, for > what reason ever. Especially when talking about directory settings. > > _______________________________________________ > systemd-devel mailing list > systemd-devel@xxxxxxxxxxxxxxxxxxxxx > https://lists.freedesktop.org/mailman/listinfo/systemd-devel _______________________________________________ systemd-devel mailing list systemd-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/systemd-devel