[systemd-devel] CREDENTIALS_DIRECTORY vs %d
Lennart Poettering
lennart at poettering.net
Thu Aug 22 09:57:58 UTC 2024
On Di, 13.08.24 01:28, Gesh (gesh at gesh.uni.cx) wrote:
> systemd.exec(5) reads:
> > In order to reference the path a credential may be read from within a
> > ExecStart= command line use "${CREDENTIALS_DIRECTORY}/mycred", e.g.
> > "ExecStart=cat ${CREDENTIALS_DIRECTORY}/mycred". In order to reference the
> > path a credential may be read from within a Environment= line use "%d/mycred",
> > e.g. "Environment=MYCREDPATH=%d/mycred".
>
> Is there a reason that the `ExecStart=` line should specifically refer to
> `$CREDENTIALS_DIRECTORY` and not `%d`? Surely these are equivalent?
They are mostly equivalent. But note that people can override
CREDENTIALS_DIRECTORY locally via Environment=, if they really wish
to. %d would be unaffected by that.
Also, if you do "systemctl show" on that unit, the %d thing will be
resolved at that time, but $CREDENTIALS_DIRECTORY will not be.
Lennart
--
Lennart Poettering, Berlin
More information about the systemd-devel
mailing list