works for Qubes terminal emulator but fails for virtual console (dom0: sudo xl console vm-name).
/etc/systemd/system.conf
DefaultEnvironment=TESTVAR=xxx
works for
Qubes Debian terminal emulator and in virtual console
Debian terminal emulator and in virtual console
/usr/lib/systemd/system.conf.d/30_kicksecure.conf
[Manager]
DefaultEnvironment=TESTVAR=1
Works for Qubes terminal emulator and in virtual console.
C) Perhaps systemd Environment= for getty? (login shell)
D) Perhaps systemd EnvironmentFile= for getty? (login shell)
E)Debian /etc/environment.d but they didn’t like my feature request. That was probably pre systemd introducing their version of /etc/environment.d. Back then I failed to follow-up with use case examples for some reason as they requested to explain why this feature was requested.
Another attempt to for a feature request /etc/environment.d from Debian (now under a different folder since it’s already taken). Even if they reject it, they might suggest - ideally - an already existing better mechanism.
F) A feature request against PAM upstream, because quote:
All packages shipped by Kicksecure / Whonix setting environment variables should deprecate their use of /etc/X11/Xsession.d and /etc/profile.d. Instead. the systemd DefaultEnvironment mechanism should be used.
This style:
Of course, split into different files and contained in the packages that require these.
Therefore not important since there are no ports / maintainers for non-systemd enabled systems anyway and also one on the horizon. Other init systems would need to support something similar to DefaultEnvironment.
systemd DefaultEnvironment mechanism doesn’t work with display manager lightdm for some reason.
Therefore porting all of Kicksecure / Whonix to systemd DefaultEnvironment mechanism is probably not a good idea until that is resolved and this being more tested in more environments.