Where to put the assignment of global environment variables
Volker Wysk
post at volker-wysk.de
Thu Sep 15 06:54:25 UTC 2022
Am Dienstag, dem 13.09.2022 um 19:42 +0200 schrieb Oliver Grawert:
> hi,
> Am Dienstag, dem 13.09.2022 um 16:01 +0200 schrieb Volker Wysk:
>
> > looks more like a system wide thing.
>
> right, and this is what you normally set in /etc/environment, which is
> the systems "environment for global variables read during boot"
> (i guess this is why peter calls it the "boot environment" :) ) ...
>
> so adding your snippets to /etc/environment.d/ is the exact right thing
> here to do ...
So, when I have something like "PATH=$PATH:/usr/local/lib/mercury.../bin"
in there, will the "$PATH" be expanded - or will I have "$PATH" instead of
"/bin:/usr/bin:/sbin:...", and the system won't be able to boot any longer
..?
> and indeed, this environment applies to the whole system, which
> includes your services and daemons, so it is only read on boot pretty
> much as the very first thing when switching from the initrd to the
> rootfs ...
Read on boot by a shell (as a shell script), or how will it be interpreted?
> this is why logout/login will not help when you add/remove
> thigs from/to it ...
Yes
Bye, V.W.
More information about the ubuntu-users
mailing list