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


Groups > linux.debian.user > #194311

Re: Ideal place to set environment variables

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups linux.debian.user
Subject Re: Ideal place to set environment variables
Date 2018-03-30 16:00 +0200
Message-ID <vz2Js-7BJ-19@gated-at.bofh.it> (permalink)
References <vv8u5-26K-1@gated-at.bofh.it> <vyMY1-63Z-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Mar 29, 2018 at 09:42:34PM +0100, Jonathan de Boyne Pollard wrote:
> I think that login.conf is a step in the right direction, and I'm planning
> on making tools that support it.  Or, rather, on making the tools that
> already support it on the BSDs also support it on Linux operating systems.
> 
> * http://netbsd.gw.com/cgi-bin/man-cgi?login.conf
> 
> * https://www.freebsd.org/cgi/man.cgi?query=login.conf
> 
> * https://man.openbsd.org/login.conf
> 
> * http://jdebp.eu./Softwares/nosh/guide/userenv-fromenv.html
> 
> I already use them to set the GUI environment from login.conf on TrueOS.
> 
> * https://unix.stackexchange.com/a/390089/5132

I have an extremely simple real-world litmus test which every system
I've ever seen so far has failed:

  How do I set MAIL=$HOME/Maildir/ in the login environment of every
  user, regardless of their shell, or how they log in (console, ssh,
  X Display Manager, GNOME Display Manager, etc.)?

That's it.  Simple, right?  But login.conf can't do it.  And pam_env.so
can't do it.  They only allow static strings with no substitutions.
In fact I'm not aware of ANYTHING that can do it.

The closest I've seen is sshd_config which uses %h and %u tokens in
some contexts, but only for specific sshd configuration parameters --
not for setting environment variables.

In the real world, today, the only solution is to duplicate that setting
in multiple places, so that (hopefully) every conceivable login method +
shell combination will pick up at least one of them.

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


Thread

Ideal place to set environment variables Subhadip Ghosh <subhadip.sky@gmail.com> - 2018-03-19 20:10 +0100
  Re: Ideal place to set environment variables Greg Wooledge <wooledg@eeg.ccf.org> - 2018-03-19 20:20 +0100
    Re: Ideal place to set environment variables Jonathan de Boyne Pollard <J.deBoynePollard-newsgroups@NTLWorld.COM> - 2018-03-29 23:10 +0200
      Re: Ideal place to set environment variables Greg Wooledge <wooledg@eeg.ccf.org> - 2018-03-30 16:00 +0200
        Re: Ideal place to set environment variables David Wright <deblis@lionunicorn.co.uk> - 2018-03-30 16:30 +0200
        Re: Ideal place to set environment variables Stefan Monnier <monnier@iro.umontreal.ca> - 2018-03-30 17:30 +0200
        Re: Ideal place to set environment variables Don Armstrong <don@debian.org> - 2018-03-30 19:20 +0200
          Re: Ideal place to set environment variables Greg Wooledge <wooledg@eeg.ccf.org> - 2018-03-30 19:40 +0200
            Re: Ideal place to set environment variables Greg Wooledge <wooledg@eeg.ccf.org> - 2018-03-30 20:20 +0200
            Re: Ideal place to set environment variables Glenn English <ghe2001@gmail.com> - 2018-03-30 21:10 +0200
          Re: Ideal place to set environment variables Don Armstrong <don@debian.org> - 2018-03-30 21:20 +0200
            Re: Ideal place to set environment variables Greg Wooledge <wooledg@eeg.ccf.org> - 2018-03-30 21:40 +0200
              Re: Ideal place to set environment variables Don Armstrong <don@debian.org> - 2018-03-30 22:00 +0200
                Re: Ideal place to set environment variables Greg Wooledge <wooledg@eeg.ccf.org> - 2018-03-30 22:10 +0200
        Re: Ideal place to set environment variables Greg Wooledge <wooledg@eeg.ccf.org> - 2018-04-09 14:40 +0200
          Re: Ideal place to set environment variables David Wright <deblis@lionunicorn.co.uk> - 2018-04-09 19:00 +0200
  Re: Ideal place to set environment variables Ben Caradoc-Davies <ben@transient.nz> - 2018-03-19 23:00 +0100
    Re: Ideal place to set environment variables Subhadip Ghosh <subhadip.sky@gmail.com> - 2018-03-20 04:20 +0100
      Re: Ideal place to set environment variables Ben Caradoc-Davies <ben@transient.nz> - 2018-03-20 04:40 +0100
        Re: Ideal place to set environment variables Subhadip Ghosh <subhadip.sky@gmail.com> - 2018-03-20 18:30 +0100

csiph-web