Where to put the assignment of global environment variables
Oliver Grawert
ogra at ubuntu.com
Tue Sep 13 17:42:21 UTC 2022
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 ...
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 ... this is why logout/login will not help when you add/remove
thigs from/to it ...
/etc/profile (or /etc/profile.d/) is *only* read by bash, ksh and ash
not by anything else on the system, so you will not find your
modifications if you i.e. use a GUI IDE or something runs from a script
using /bin/sh as its shell or whatnot ...
ciao
oli
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20220913/6d13fbb0/attachment.sig>
More information about the ubuntu-users
mailing list