[systemd-devel] Accpetance of Environment Variables in Attributes

Lennart Poettering lennart at poettering.net
Thu Jun 25 12:30:48 UTC 2020


On Do, 25.06.20 14:07, Ede Wolf (listac at nebelschwaden.de) wrote:

>
> > I am not sure what made you think this works, but systemd has no
>
> Pure logic of conclusion. Besides this being a sensible thing to be
> able to

Nah, unless you write a shell or templating language I doubt variable
expansion is a good thing.

> do, why is LimitMEMLOCK not causing the unit to fail, when given a (non
> existing) variable? Or, since it is no variable from a systemd point of
> view, but a mere string, why does that not cause a failure? $MEM should not
> be a valid argument to ulimit -l (or the underlying syscall).

There should be a log message about this in the logs. Generally we
continue parsing if we hit something we cannot parse in order to
ensure that unit files can safely use newer features but still
somewhat reasonably work on older systemds.

> > but systemd has no concept of env var expansion in unit files. It's not a shell.
>
> That is unfortunate (not the shell part, but the variable one), but thanks
> for the explanation, that helps.

If you want a shell, use a shell.

Lennart

--
Lennart Poettering, Berlin


More information about the systemd-devel mailing list