Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #178201

Re: The same environment variables everywhere

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups linux.debian.user
Subject Re: The same environment variables everywhere
Date 2017-02-27 14:20 +0100
Message-ID <tftnA-65z-17@gated-at.bofh.it> (permalink)
References <tf67E-6Iq-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Feb 26, 2017 at 02:26:08PM +0200, Teemu Likonen wrote:
> I would like to hear some ideas on how to set various environment
> variables (PATH, MANPATH, EDITOR etc.) in one place that would make them
> effective everywhere. My "everywhere" means:
> 
>   - X session started through lightdm and ~/.xsession script
>   - Linux console login (bash)
>   - user's systemd services

The last one is simply not going to happen the way you seem to expect.
You should change the jobs launched by systemd to dot in the appropriate
file, instead of expecting systemd to load some interactive shell config
automatically.

As for the first two... well.  You know WHY there is a separation, right?
People put crap in .profile that would not work properly in an X config
file, because there is no terminal.  For example, /usr/games/fortune,
or something that probes the terminal settings.  The complete absence of
an underlying terminal, not to mention a TERM variable, would make many
.profile files fail, which is why .profile is not read by X startups.

However, if *you* have personally vetted your .profile and believe that
it will run safely in an X startup environment with no terminal, then
you can simply dot it in from ~/.xsessionrc and voila.

(Do not confuse ~/.xsessionrc and ~/.xsession; they are very different.)

Back to linux.debian.user | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

The same environment variables everywhere Teemu Likonen <tlikonen@iki.fi> - 2017-02-26 13:30 +0100
  Re: The same environment variables everywhere Matthias Bodenbinder <matthias@bodenbinder.de> - 2017-02-26 21:00 +0100
    Re: The same environment variables everywhere Stefan Monnier <monnier@iro.umontreal.ca> - 2017-02-27 06:00 +0100
      Re: The same environment variables everywhere deloptes <deloptes@gmail.com> - 2017-02-27 09:10 +0100
        Re: The same environment variables everywhere <tomas@tuxteam.de> - 2017-02-27 09:20 +0100
          Re: The same environment variables everywhere GiaThnYgeia <GiaThnYgeia@openmailbox.org> - 2017-02-27 12:40 +0100
            Re: The same environment variables everywhere Elimar Riesebieter <riesebie@lxtec.de> - 2017-02-27 13:40 +0100
          Re: The same environment variables everywhere Teemu Likonen <tlikonen@iki.fi> - 2017-02-27 14:30 +0100
            Re: The same environment variables everywhere David Wright <deblis@lionunicorn.co.uk> - 2017-02-27 18:10 +0100
              Re: The same environment variables everywhere Teemu Likonen <tlikonen@iki.fi> - 2017-02-27 19:00 +0100
                Re: The same environment variables everywhere Nicolas George <george@nsup.org> - 2017-02-27 19:20 +0100
                systemd service environment Teemu Likonen <tlikonen@iki.fi> - 2017-02-27 19:50 +0100
          Re: The same environment variables everywhere deloptes <deloptes@gmail.com> - 2017-02-27 19:30 +0100
  Re: The same environment variables everywhere Greg Wooledge <wooledg@eeg.ccf.org> - 2017-02-27 14:20 +0100

csiph-web