Re: Setting default $PATH for all users

2019-02-11 Thread David Wright
On Mon 11 Feb 2019 at 17:48:23 (-), Curt wrote:
> On 2019-02-11, Greg Wooledge  wrote:
> > On Mon, Feb 11, 2019 at 05:26:34PM -, Curt wrote:
> >> I follow your logic. Give me everything in /etc/skel/ beginning with a dot.
> >> Which works. But apparently a dot is also something else. Like a directory.
> >> 
> >> curty@einstein:~$ ls /etc/skel/.*
> >> /etc/skel/.bash_logout  /etc/skel/.bashrc  /etc/skel/.profile
> >> 
> >> /etc/skel/.:
> >> 
> >> /etc/skel/..:
> >> 
> >> (etc.--the contents of /etc/
> >> 
> >> I'm not sure what it all means.
> >
> > The shell glob .* expands to everything in the current directory that
> > begins with a dot.  Which includes "." and "..".
> >
> > "." is the current directory.  ".." is the parent directory.  E.g. when
> > you type "cd .." it moves you "up" to the parent directory.
> >
> > Asking ls to show you .* is usually a bad idea, precisely because it
> > expands to a list which includes . and .. and does exactly what you
> > just described.
> >
> > This is why the ls command has -a and -A options.
> 
> Thank you. That all makes perfect sense.

If you want just the dotfiles, thenls -dF  .[^.]*
might be helpful. You don't need the -dF, but -d will prevent
it listing any .dotdirectories (important in your $HOME) and
-F will reveal those directories (when you're not using -l)
and other non-regular-files.

Cheers,
David.



Re: Setting default $PATH for all users

2019-02-11 Thread Curt
On 2019-02-11, Greg Wooledge  wrote:
> On Mon, Feb 11, 2019 at 05:26:34PM -, Curt wrote:
>> I follow your logic. Give me everything in /etc/skel/ beginning with a dot.
>> Which works. But apparently a dot is also something else. Like a directory.
>> 
>> curty@einstein:~$ ls /etc/skel/.*
>> /etc/skel/.bash_logout  /etc/skel/.bashrc  /etc/skel/.profile
>> 
>> /etc/skel/.:
>> 
>> /etc/skel/..:
>> 
>> (etc.--the contents of /etc/
>> 
>> I'm not sure what it all means.
>
> The shell glob .* expands to everything in the current directory that
> begins with a dot.  Which includes "." and "..".
>
> "." is the current directory.  ".." is the parent directory.  E.g. when
> you type "cd .." it moves you "up" to the parent directory.
>
> Asking ls to show you .* is usually a bad idea, precisely because it
> expands to a list which includes . and .. and does exactly what you
> just described.
>
> This is why the ls command has -a and -A options.
>
>

Thank you. That all makes perfect sense.



Re: Setting default $PATH for all users

2019-02-11 Thread Greg Wooledge
On Mon, Feb 11, 2019 at 05:26:34PM -, Curt wrote:
> I follow your logic. Give me everything in /etc/skel/ beginning with a dot.
> Which works. But apparently a dot is also something else. Like a directory.
> 
> curty@einstein:~$ ls /etc/skel/.*
> /etc/skel/.bash_logout  /etc/skel/.bashrc  /etc/skel/.profile
> 
> /etc/skel/.:
> 
> /etc/skel/..:
> 
> (etc.--the contents of /etc/
> 
> I'm not sure what it all means.

The shell glob .* expands to everything in the current directory that
begins with a dot.  Which includes "." and "..".

"." is the current directory.  ".." is the parent directory.  E.g. when
you type "cd .." it moves you "up" to the parent directory.

Asking ls to show you .* is usually a bad idea, precisely because it
expands to a list which includes . and .. and does exactly what you
just described.

This is why the ls command has -a and -A options.



Re: Setting default $PATH for all users

2019-02-11 Thread Curt
On 2019-02-11, rhkra...@gmail.com  wrote:
> On Monday, February 11, 2019 08:07:24 AM Curt wrote:
>> On 2019-02-11, rhkra...@gmail.com  wrote:
>> > There is a directory /etc/sket (with all hidden files thus you need
>> > something like ls /etc/skel/.* to get a listing).
>> 
>> I believe you need something like 'ls -a /etc/skel/', in fact, to see those
>> pesky dot files.
>
> You're right.

I'm wrong because your command does output the dot files, as a matter of
fact (and so much more I didn't bother scrolling up to notice that it
did indeed show those hidden files).

I follow your logic. Give me everything in /etc/skel/ beginning with a dot.
Which works. But apparently a dot is also something else. Like a directory.

curty@einstein:~$ ls /etc/skel/.*
/etc/skel/.bash_logout  /etc/skel/.bashrc  /etc/skel/.profile

/etc/skel/.:

/etc/skel/..:

(etc.--the contents of /etc/

I'm not sure what it all means.

>> Your command, actually, have you tried it? 
>
> Of course, for a command that simple, I almost always try it, and I got 
> plenty 
> of results that, at first glance, seemed plausible, but looking back, they 
> were 
> wrong.
>
>> It produces results that are
>> different from what you expected, I think.
>
>



Re: Setting default $PATH for all users

2019-02-11 Thread rhkramer
On Monday, February 11, 2019 08:07:24 AM Curt wrote:
> On 2019-02-11, rhkra...@gmail.com  wrote:
> > There is a directory /etc/sket (with all hidden files thus you need
> > something like ls /etc/skel/.* to get a listing).
> 
> I believe you need something like 'ls -a /etc/skel/', in fact, to see those
> pesky dot files.

You're right.

> Your command, actually, have you tried it? 

Of course, for a command that simple, I almost always try it, and I got plenty 
of results that, at first glance, seemed plausible, but looking back, they were 
wrong.

> It produces results that are
> different from what you expected, I think.



Re: Setting default $PATH for all users

2019-02-11 Thread Greg Wooledge
On Sun, Feb 10, 2019 at 07:28:02PM -0500, Lee wrote:
> Which is semi-interesting I guess, but you're the one that wanted a
> single location to add $PATH elements for all current & future users -
> yes?  The interesting answer would be if adding
> export PATH=$PATH:/foo
> to /etc/bash.bashrc is what you're looking for.

This only adds the PATH component to interactive bash shells.  It does
not, for example, add it to window managers, desktop environments, web
browsers launched from window manager menus, etc.  Nor does it affect
users of other shells than bash.

 gives a decent overview of
how some logins work, including a tiny bit of Debian-specific stuff.
It's missing some pieces (e.g. Debian's ~/.xsessionrc, Arch Linux's
~/.xprofile, warnings about GNOME/dbus), but it's a good start.

See  for a bit more info on the
Debian-specific stuff, including the ~/.xsessionrc file.

 is based on an older version of that
page and may also be helpful.  I wrote the original page on tarzeau's
forerunner of the Debian wiki, and he migrated it to the current wiki
in 2007.  Looks like there have been just a few edits since then, so
the bulk of the page is still my original writing from 15 years ago.
Comparing to the current version on wooledge.org will show you how my
writing has improved since then.  It's still a lifelong learning process.



Re: Setting default $PATH for all users

2019-02-11 Thread David Wright
On Mon 11 Feb 2019 at 09:53:39 (+0100), to...@tuxteam.de wrote:
> On Sun, Feb 10, 2019 at 04:22:44PM -0600, Richard Owlett wrote:
> > On 02/10/2019 03:42 PM, to...@tuxteam.de wrote:
> > >On Sun, Feb 10, 2019 at 02:57:22PM -0600, Richard Owlett wrote:
> > >
> > >[...]
> > >
> > >>Unless someone can point to a single location to modify that:
> > >>   1. modify existing user(s)
> > >>   2. have effect for ALL future users
> > >>   3. survive updating to future releases
> > >>I'll drop the issue.
> > >>Thanks all.
> > >
> > >Did you ever give consideration to the stuff in /etc/X11/xsession.d?
> > 
> > Yes.
> > Also looked at other X11 links suggested by drilling down thru links
> > to links ...
> > 
> > Having just been taught the value of "grep" I just did
> > "grep -r path /etc/X11" and "grep -r PATH /etc/X11" to see if I had
> > missed anything. Hadn't.
> 
> It's not (necessarily) about a PATH being there. Rather about you
> putting one there, usually in the form:
> 
>   PATH="/my/preferred/path:$PATH
> 
> (substitute as appropriate). Or append your preferred paths if you
> want the usual suspects (/bin, /usr/bin, etc.) to take precedence.
> Or both.

Well, I had expected that there might be some defaults set somewhere
in a text file (or as comments) …

> > >What's in that directory (on your machine)?
> > 
> > >root@fromdell:/home/richard# ls /etc/X11/Xsession.d
> > >20dbus_xdg-runtime50x11-common_determine-startup  90gpg-agent
> > >20vdpau-va-gl 55mate-session_materc   90qt-a11y
> > >20x11-common_process-args  60xbrlapi  
> > >90x11-common_ssh-agent
> > >30x11-common_xresources60xdg-user-dirs-update 
> > >95dbus_update-activation-env
> > >35x11-common_xhost-local   75dbus_dbus-launch 
> > >99mate-environment
> > >40x11-common_xsessionrc90atk-adaptor  99x11-common_start
> 
> Looks pretty standard. Now do try putting a new file into Xsession.d
> containing a line as suggested above and named, e.g. "97richards-path"
> or something similar (92 means it happens near the end, the rest
> is just for you to remember the perpetrator). Decorate it with some
> comments. Remember, it's shell text which is "sourced" (i.e. included
> as part, not executed in a subshell) by some bigger thing.
> 
> > >root@fromdell:/home/richard#
> > 
> > [https://launchpadlibrarian.net/94971962/01_set-default-path.patch]
> > and [https://lists.debian.org/debian-user/2014/04/msg6.html]
> > indicate that at one time the behavior was hard coded into lightdm.
> 
> I'll believe that when I see it. I don't think they bypass the X11
> session mechanism.

… but perhaps not. I notice that the patch is for else clauses,
which could indicate fallback PATHs when nothing else is found.

And these patches do look like they're in the code:

 $ strings /tmp/lightdm/usr/sbin/lightdm | grep /bin:
 /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
 /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
 PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
 $ 

Cheers,
David.



Re: Setting default $PATH for all users

2019-02-11 Thread Curt
On 2019-02-11, rhkra...@gmail.com  wrote:
> On Monday, February 11, 2019 03:57:14 AM to...@tuxteam.de wrote:
>> On Sun, Feb 10, 2019 at 09:07:13PM -0600, David Wright wrote:
>> > On Fri 08 Feb 2019 at 10:08:49 (-0500), Dan Ritter wrote:
>> > > Richard Owlett wrote:
>> > > > By my problem definition, any thing in /home/user is not relevant as
>> > > > I explicitly want something that affects all current and future
>> > > > users.
>> > > 
>> > > Everybody, no matter what?
>
> Well, this is probably OP (off point), but not OT (off topic).
>
> There is a directory /etc/sket (with all hidden files thus you need something 
> like ls /etc/skel/.* to get a listing).

I believe you need something like 'ls -a /etc/skel/', in fact, to see those 
pesky dot
files.

Your command, actually, have you tried it? It produces results that are
different from what you expected, I think.

> AIUI, these files are used, when a new user is created, to create the initial 
> instance of those files for the new user.  It includes files like bashrc (and 
> lots of others).
>
> Maybe that will be of some help for future users.
>
>


-- 

When you have fever you are heavy and light, you are small and swollen, you
climb endlessly a ladder which turns like a wheel. 
Jean Rhys, Voyage in the Dark



Re: Setting default $PATH for all users

2019-02-11 Thread rhkramer
On Monday, February 11, 2019 03:57:14 AM to...@tuxteam.de wrote:
> On Sun, Feb 10, 2019 at 09:07:13PM -0600, David Wright wrote:
> > On Fri 08 Feb 2019 at 10:08:49 (-0500), Dan Ritter wrote:
> > > Richard Owlett wrote:
> > > > By my problem definition, any thing in /home/user is not relevant as
> > > > I explicitly want something that affects all current and future
> > > > users.
> > > 
> > > Everybody, no matter what?

Well, this is probably OP (off point), but not OT (off topic).

There is a directory /etc/sket (with all hidden files thus you need something 
like ls /etc/skel/.* to get a listing).

AIUI, these files are used, when a new user is created, to create the initial 
instance of those files for the new user.  It includes files like bashrc (and 
lots of others).

Maybe that will be of some help for future users.



Re: Setting default $PATH for all users

2019-02-11 Thread tomas
On Sun, Feb 10, 2019 at 09:07:13PM -0600, David Wright wrote:
> On Fri 08 Feb 2019 at 10:08:49 (-0500), Dan Ritter wrote:
> > Richard Owlett wrote: 
> > > By my problem definition, any thing in /home/user is not relevant as I
> > > explicitly want something that affects all current and future users.
> > 
> > Everybody, no matter what?
> > 
> > pam_env can do that.
> > 
> > PAM is the pluggable authentication module system, and controls
> > all sorts of logins.
> > 
> > man pam_env  for instructions.
> 
> Good point. And I notice that /etc/pam.d/lightdm talks about
> 
> # Load environment from /etc/environment and ~/.pam_environment
> session  required pam_env.so readenv=1
> session  required pam_env.so readenv=1 envfile=/etc/default/locale
> 
> so experimenting with those files might be an idea.
> 
> BTW I notice that /etc/security/pam_env.conf contains a line that can
> *set* the PATH, but only contains "PATH", not "PATH=". So I'm afraid
> the OP should be searching /etc for USER rather than USER=, even
> though this will output a lot more noise.

As already stated, PAM is an interesting alternative to the X11 path
pursued in another fork of this thread: interesting mainly because
it applies /also/ to other access --um-- paths to the computer (Linux
console, ssh, (ugh!) telnet -- basically everything which eventually
asks PAM for access permission).

It is thus more "universal" than the X11 --um-- path.

Cheers
-- tomás


signature.asc
Description: Digital signature


Re: Setting default $PATH for all users

2019-02-11 Thread tomas
On Sun, Feb 10, 2019 at 04:22:44PM -0600, Richard Owlett wrote:
> On 02/10/2019 03:42 PM, to...@tuxteam.de wrote:
> >On Sun, Feb 10, 2019 at 02:57:22PM -0600, Richard Owlett wrote:
> >
> >[...]
> >
> >>Unless someone can point to a single location to modify that:
> >>   1. modify existing user(s)
> >>   2. have effect for ALL future users
> >>   3. survive updating to future releases
> >>I'll drop the issue.
> >>Thanks all.
> >
> >Did you ever give consideration to the stuff in /etc/X11/xsession.d?
> 
> Yes.
> Also looked at other X11 links suggested by drilling down thru links
> to links ...
> 
> Having just been taught the value of "grep" I just did
> "grep -r path /etc/X11" and "grep -r PATH /etc/X11" to see if I had
> missed anything. Hadn't.

It's not (necessarily) about a PATH being there. Rather about you
putting one there, usually in the form:

  PATH="/my/preferred/path:$PATH

(substitute as appropriate). Or append your preferred paths if you
want the usual suspects (/bin, /usr/bin, etc.) to take precedence.
Or both.

> >What's in that directory (on your machine)?
> 
> >root@fromdell:/home/richard# ls /etc/X11/Xsession.d
> >20dbus_xdg-runtime  50x11-common_determine-startup  90gpg-agent
> >20vdpau-va-gl   55mate-session_materc   90qt-a11y
> >20x11-common_process-args  60xbrlapi
> >90x11-common_ssh-agent
> >30x11-common_xresources60xdg-user-dirs-update   
> >95dbus_update-activation-env
> >35x11-common_xhost-local   75dbus_dbus-launch   
> >99mate-environment
> >40x11-common_xsessionrc90atk-adaptor99x11-common_start

Looks pretty standard. Now do try putting a new file into Xsession.d
containing a line as suggested above and named, e.g. "97richards-path"
or something similar (92 means it happens near the end, the rest
is just for you to remember the perpetrator). Decorate it with some
comments. Remember, it's shell text which is "sourced" (i.e. included
as part, not executed in a subshell) by some bigger thing.

> >root@fromdell:/home/richard#
> 
> [https://launchpadlibrarian.net/94971962/01_set-default-path.patch]
> and [https://lists.debian.org/debian-user/2014/04/msg6.html]
> indicate that at one time the behavior was hard coded into lightdm.

I'll believe that when I see it. I don't think they bypass the X11
session mechanism.

Cheers
-- tomás


signature.asc
Description: Digital signature


Re: Setting default $PATH for all users

2019-02-10 Thread David Wright
On Fri 08 Feb 2019 at 10:08:49 (-0500), Dan Ritter wrote:
> Richard Owlett wrote: 
> > By my problem definition, any thing in /home/user is not relevant as I
> > explicitly want something that affects all current and future users.
> 
> Everybody, no matter what?
> 
> pam_env can do that.
> 
> PAM is the pluggable authentication module system, and controls
> all sorts of logins.
> 
> man pam_env  for instructions.

Good point. And I notice that /etc/pam.d/lightdm talks about

# Load environment from /etc/environment and ~/.pam_environment
session  required pam_env.so readenv=1
session  required pam_env.so readenv=1 envfile=/etc/default/locale

so experimenting with those files might be an idea.

BTW I notice that /etc/security/pam_env.conf contains a line that can
*set* the PATH, but only contains "PATH", not "PATH=". So I'm afraid
the OP should be searching /etc for USER rather than USER=, even
though this will output a lot more noise.

Cheers,
David.



Re: Setting default $PATH for all users

2019-02-10 Thread David Wright
On Sun 10 Feb 2019 at 14:57:22 (-0600), Richard Owlett wrote:
> On 02/08/2019 12:55 PM, David Wright wrote:
> > On Fri 08 Feb 2019 at 07:18:39 (-0600), Richard Owlett wrote:
> > > I'm running Debian Stretch with MATE desktop.
> > > I want the current user and all future users to include all
> > > directories in root's $PATH.
> > 
> > If you're talking about PATH, then you're talking about logging in.
> > So of equal importance to the DE you're using is the DM, and I'll
> > guess that's likely lightdm. Was that amongst your search terms? >
> > > I haven't found a definitive answer in my web search. The answers
> > > seem to depend on which Linux is used and multiple parameters.
> > 
> > Yes, as are so many other details of configuration.
> > 
> > If searching outwards gets you no further, then perhaps turn your
> > attention inwards. For example,   grep -r PATH /etc   or, a little
> > less noisy,   grep -r PATH= /etc   will reveal some candidates
> > (plus lots of false positives, which the filenames will make obvious).
> 
> I used "grep -r /usr/local/games /etc" which yielded "/etc/login.defs"
> and "/etc/profile".

You've lost me. I don't see much similarity between:

grep -r PATH= /etc

and

grep -r /usr/local/games /etc

> Editing those two files had no effect.

There's little point in posting a sentence like that. You don't show
what edits you did, nor what tests you performed.

> I did a new search including "lightdm" as one term.

I assume that's confirmation that you do use a DM.
In which case many people here may have difficulty helping you
directly as they're going to be like me: not using one.

So I can only make suggestions as to where to look. I don't know
what you'll find where, and whether it'll help. I've read that
DMs and DEs can be difficult to bend to your will.

> I got multiple hits - [none seemed authoritative].

I've no idea what that means. There are plenty of lightdm docs/wikis
out there. Do you expect some sort of .gov website?

> I did get one hit which hints I may not get what I want.

Do you mean that someone posted that they gave up trying? …

> A thread discussing a quite different situation says in part:
> > The basic problem is that lightdm in Debian hard-codes the path
> > https://launchpadlibrarian.net/94971962/01_set-default-path.patch
>   [https://lists.debian.org/debian-user/2014/04/msg6.html]
> Although the link is to a Ubuntu bug report, not Debian, the code
> shown is consistent with my observations.

… or is that your one hit?

> Unless someone can point to a single location to modify that:
>   1. modify existing user(s)
>   2. have effect for ALL future users
>   3. survive updating to future releases
> I'll drop the issue.

I don't think there is just one location to set an environment
variable for every access method and in every circumstance.
So it might help to know what you really want to do. After all,
every PATH= line has a specific purpose. What's yours?

Cheers,
David.



Re: Setting default $PATH for all users

2019-02-10 Thread Lee
On 2/10/19, Richard Owlett  wrote:
> On 02/10/2019 05:00 PM, Lee wrote:
>> On 2/10/19, Andy Smith  wrote:
>>> Hello,
>>>
>>> On Sun, Feb 10, 2019 at 02:57:22PM -0600, Richard Owlett wrote:
 I used "grep -r /usr/local/games /etc" which yielded "/etc/login.defs"
 and
 "/etc/profile". Editing those two files had no effect.
>>>
>>> How are you determining that changes to /etc/profile had no effect?
>>> Because changes there (or in files in /etc/profile.d/) should affect all
>>> new shels that you launch. Example:
>>>
>>> $ cat /etc/profile.d/extrapath.sh
>>> export PATH=$PATH:/foo
>>>
>>> Then I open a new shell and echo $PATH, /foo is in there.
>>>
>>> If that is not your experience, you are doing something wrong, or your
>>> system is very broken.
>>
>> Or you're using xfce which seems to ignore .profile & .bash_profile
>> Creating an /etc/profile.d/extrapath.sh from your example didn't do
>> anything for me.
>>
>> adding the line
>> export PATH=$PATH:/foo
>> to /etc/bash.bashrc however...
>>
>> followup question - why are the bash "login" dot files ignored if
>> you're using xfce?
>
> Perhaps 'cause I've never used xfce?
> For the record I'm using MATE as DE and lightdm as DM.

Which is semi-interesting I guess, but you're the one that wanted a
single location to add $PATH elements for all current & future users -
yes?  The interesting answer would be if adding
export PATH=$PATH:/foo
to /etc/bash.bashrc is what you're looking for.

Regards,
Lee



Re: Setting default $PATH for all users

2019-02-10 Thread Andy Smith
On Sun, Feb 10, 2019 at 03:49:00PM -0600, Richard Owlett wrote:
> On 02/10/2019 03:26 PM, Andy Smith wrote:
> >So what changes are you making and how are you checking for them?

I note you have neglected to explain what changes you are making, which
would be essential for us to help you with why the changes are seemingly
not taking effect. As such this seems like yet another endless Owlett
thread where assistance is not actually desired, and so I'm out. Good
luck to you and any who take on the task.

Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting



Re: Setting default $PATH for all users

2019-02-10 Thread Richard Owlett

On 02/10/2019 05:00 PM, Lee wrote:

On 2/10/19, Andy Smith  wrote:

Hello,

On Sun, Feb 10, 2019 at 02:57:22PM -0600, Richard Owlett wrote:

I used "grep -r /usr/local/games /etc" which yielded "/etc/login.defs"
and
"/etc/profile". Editing those two files had no effect.


How are you determining that changes to /etc/profile had no effect?
Because changes there (or in files in /etc/profile.d/) should affect all
new shels that you launch. Example:

$ cat /etc/profile.d/extrapath.sh
export PATH=$PATH:/foo

Then I open a new shell and echo $PATH, /foo is in there.

If that is not your experience, you are doing something wrong, or your
system is very broken.


Or you're using xfce which seems to ignore .profile & .bash_profile
Creating an /etc/profile.d/extrapath.sh from your example didn't do
anything for me.

adding the line
export PATH=$PATH:/foo
to /etc/bash.bashrc however...

followup question - why are the bash "login" dot files ignored if
you're using xfce?


Perhaps 'cause I've never used xfce?
For the record I'm using MATE as DE and lightdm as DM.



Regards,
Lee








Re: Setting default $PATH for all users

2019-02-10 Thread Lee
On 2/10/19, Andy Smith  wrote:
> Hello,
>
> On Sun, Feb 10, 2019 at 02:57:22PM -0600, Richard Owlett wrote:
>> I used "grep -r /usr/local/games /etc" which yielded "/etc/login.defs"
>> and
>> "/etc/profile". Editing those two files had no effect.
>
> How are you determining that changes to /etc/profile had no effect?
> Because changes there (or in files in /etc/profile.d/) should affect all
> new shels that you launch. Example:
>
> $ cat /etc/profile.d/extrapath.sh
> export PATH=$PATH:/foo
>
> Then I open a new shell and echo $PATH, /foo is in there.
>
> If that is not your experience, you are doing something wrong, or your
> system is very broken.

Or you're using xfce which seems to ignore .profile & .bash_profile
Creating an /etc/profile.d/extrapath.sh from your example didn't do
anything for me.

adding the line
export PATH=$PATH:/foo
to /etc/bash.bashrc however...

followup question - why are the bash "login" dot files ignored if
you're using xfce?

Regards,
Lee



Re: Setting default $PATH for all users

2019-02-10 Thread Richard Owlett

On 02/10/2019 03:42 PM, to...@tuxteam.de wrote:

On Sun, Feb 10, 2019 at 02:57:22PM -0600, Richard Owlett wrote:

[...]


Unless someone can point to a single location to modify that:
   1. modify existing user(s)
   2. have effect for ALL future users
   3. survive updating to future releases
I'll drop the issue.
Thanks all.


Did you ever give consideration to the stuff in /etc/X11/xsession.d?


Yes.
Also looked at other X11 links suggested by drilling down thru links to 
links ...


Having just been taught the value of "grep" I just did
"grep -r path /etc/X11" and "grep -r PATH /etc/X11" to see if I had 
missed anything. Hadn't.




What's in that directory (on your machine)?


 
root@fromdell:/home/richard# ls /etc/X11/Xsession.d

20dbus_xdg-runtime 50x11-common_determine-startup  90gpg-agent
20vdpau-va-gl  55mate-session_materc   90qt-a11y
20x11-common_process-args  60xbrlapi   
90x11-common_ssh-agent
30x11-common_xresources60xdg-user-dirs-update  
95dbus_update-activation-env
35x11-common_xhost-local   75dbus_dbus-launch  99mate-environment
40x11-common_xsessionrc90atk-adaptor   99x11-common_start
root@fromdell:/home/richard# 


[https://launchpadlibrarian.net/94971962/01_set-default-path.patch] and 
[https://lists.debian.org/debian-user/2014/04/msg6.html] indicate 
that at one time the behavior was hard coded into lightdm.





Cheers
-- t






Re: Setting default $PATH for all users

2019-02-10 Thread Richard Owlett

On 02/10/2019 03:26 PM, Andy Smith wrote:

Hello,

On Sun, Feb 10, 2019 at 02:57:22PM -0600, Richard Owlett wrote:

I used "grep -r /usr/local/games /etc" which yielded "/etc/login.defs" and
"/etc/profile". Editing those two files had no effect.


How are you determining that changes to /etc/profile had no effect?


Being of the vacuum tube, 026, KSR35 era 
I did a brute force reboot [i.e. power off; wait; power on]


Because changes there (or in files in /etc/profile.d/) should affect all
new shels that you launch. Example:

$ cat /etc/profile.d/extrapath.sh
export PATH=$PATH:/foo

Then I open a new shell and echo $PATH, /foo is in there.

If that is not your experience, you are doing something wrong, or your
system is very broken.


Depends on your definition of broken ;/
The links you snipped suggest lightdm could be defined as broken.



So what changes are you making and how are you checking for them?

Cheers,
Andy






Re: Setting default $PATH for all users

2019-02-10 Thread tomas
On Sun, Feb 10, 2019 at 02:57:22PM -0600, Richard Owlett wrote:

[...]

> Unless someone can point to a single location to modify that:
>   1. modify existing user(s)
>   2. have effect for ALL future users
>   3. survive updating to future releases
> I'll drop the issue.
> Thanks all.

Did you ever give consideration to the stuff in /etc/X11/xsession.d?

What's in that directory (on your machine)?

Cheers
-- t


signature.asc
Description: Digital signature


Re: Setting default $PATH for all users

2019-02-10 Thread Andy Smith
Hello,

On Sun, Feb 10, 2019 at 02:57:22PM -0600, Richard Owlett wrote:
> I used "grep -r /usr/local/games /etc" which yielded "/etc/login.defs" and
> "/etc/profile". Editing those two files had no effect.

How are you determining that changes to /etc/profile had no effect?
Because changes there (or in files in /etc/profile.d/) should affect all
new shels that you launch. Example:

$ cat /etc/profile.d/extrapath.sh
export PATH=$PATH:/foo

Then I open a new shell and echo $PATH, /foo is in there.

If that is not your experience, you are doing something wrong, or your
system is very broken.

So what changes are you making and how are you checking for them?

Cheers,
Andy

-- 
https://bitfolk.com/ -- No-nonsense VPS hosting



Re: Setting default $PATH for all users

2019-02-10 Thread Richard Owlett

On 02/08/2019 12:55 PM, David Wright wrote:

On Fri 08 Feb 2019 at 07:18:39 (-0600), Richard Owlett wrote:

I'm running Debian Stretch with MATE desktop.
I want the current user and all future users to include all
directories in root's $PATH.


If you're talking about PATH, then you're talking about logging in.
So of equal importance to the DE you're using is the DM, and I'll
guess that's likely lightdm. Was that amongst your search terms? >

I haven't found a definitive answer in my web search. The answers
seem to depend on which Linux is used and multiple parameters.


Yes, as are so many other details of configuration.

If searching outwards gets you no further, then perhaps turn your
attention inwards. For example,   grep -r PATH /etc   or, a little
less noisy,   grep -r PATH= /etc   will reveal some candidates
(plus lots of false positives, which the filenames will make obvious).


I used "grep -r /usr/local/games /etc" which yielded "/etc/login.defs" 
and "/etc/profile". Editing those two files had no effect.


I did a new search including "lightdm" as one term.
I got multiple hits - [none seemed authoritative].

I did get one hit which hints I may not get what I want.

A thread discussing a quite different situation says in part:
The basic problem is that lightdm in Debian hard-codes the path 
  https://launchpadlibrarian.net/94971962/01_set-default-path.patch

[https://lists.debian.org/debian-user/2014/04/msg6.html]
Although the link is to a Ubuntu bug report, not Debian, the code shown 
is consistent with my observations.


Unless someone can point to a single location to modify that:
  1. modify existing user(s)
  2. have effect for ALL future users
  3. survive updating to future releases
I'll drop the issue.
Thanks all.









Cheers,
David.








Re: Setting default $PATH for all users

2019-02-08 Thread David Wright
On Fri 08 Feb 2019 at 07:18:39 (-0600), Richard Owlett wrote:
> I'm running Debian Stretch with MATE desktop.
> I want the current user and all future users to include all
> directories in root's $PATH.

If you're talking about PATH, then you're talking about logging in.
So of equal importance to the DE you're using is the DM, and I'll
guess that's likely lightdm. Was that amongst your search terms?

> I haven't found a definitive answer in my web search. The answers
> seem to depend on which Linux is used and multiple parameters.

Yes, as are so many other details of configuration.

If searching outwards gets you no further, then perhaps turn your
attention inwards. For example,   grep -r PATH /etc   or, a little
less noisy,   grep -r PATH= /etc   will reveal some candidates
(plus lots of false positives, which the filenames will make obvious).

Cheers,
David.



Re: Setting default $PATH for all users

2019-02-08 Thread tomas
On Fri, Feb 08, 2019 at 08:58:28AM -0600, Richard Owlett wrote:
> On 02/08/2019 07:37 AM, to...@tuxteam.de wrote:
> >More background: processes inherit their environment from their

> >parent process, and so on.
> >
> >[snip] there are "checkpoints" at which the (user) environment
> >can be set.
> >
> >Traditionally that happens at login (/etc/profile,
> 
> Edited that to *NO* effect.

I said "traditionally": there your primary "login" is a shell.
For X and graphical environments, it's another story.

> >~/.profile
> 
> By my problem definition, any thing in /home/user is not relevant as
> I explicitly want something that affects all current and future
> users.

Right -- I mentioned that for completeness, since this is a recurring
pattern: a system-wide config which can be overridden per user.

> >But X. When X came up [...]

> >See "man Xsession" and the scripts in /etc/X11/Xsession* -- they
> >are shell scripts and might inspire you.
> 
> No mention of path there.

No need: those are shell snippeds sourced by the X session shell,
which will be the mother of all your X processes -- and PATH is
part of their inherited environment. Setting PATH there will be
inherited by those.

But see Dan's other take -- pam will set things (among others
the PATH for any authentication which goes via PAM (i.e. the
display manager, where you log into X, a shell in a console,
or even an ssh from another box).

Cheers
-- tomás


signature.asc
Description: Digital signature


Re: Setting default $PATH for all users

2019-02-08 Thread Dan Ritter
Richard Owlett wrote: 
> By my problem definition, any thing in /home/user is not relevant as I
> explicitly want something that affects all current and future users.

Everybody, no matter what?

pam_env can do that.

PAM is the pluggable authentication module system, and controls
all sorts of logins.

man pam_env  for instructions.

-dsr-



Re: Setting default $PATH for all users

2019-02-08 Thread Richard Owlett

On 02/08/2019 07:37 AM, to...@tuxteam.de wrote:

On Fri, Feb 08, 2019 at 08:22:54AM -0500, Roberto C. Sánchez wrote:

On Fri, Feb 08, 2019 at 07:18:39AM -0600, Richard Owlett wrote:

I'm running Debian Stretch with MATE desktop.
I want the current user and all future users to include all directories in
root's $PATH.

I haven't found a definitive answer in my web search. The answer's seem to
depend on which Linux is used and multiple parameters.


As with most things in Linux and Unix, it depends.

Some likely candidates are /etc/bash.bashrc, /etc/profile,
/etc/profile.d/, and /etc/environment.


More background: processes inherit their environment from their
parent process, and so on.

[snip] there are "checkpoints" at which the (user) environment
can be set.

Traditionally that happens at login (/etc/profile,


Edited that to *NO* effect.


~/.profile


By my problem definition, any thing in /home/user is not relevant as I 
explicitly want something that affects all current and future users.




and all their shell-specific variations -- sometimes you want
slightly different environments for different shells).

But X. When X came up, a similar mechanism was introduced, to
let programs started directly from X also have nice environments:
That is where Xsession (of which there are system-wide scripts
in (Debian, at least) /etc/X11/Xsession, typically broken up
in task-specific snippets in /etc/X11/Xsession.d -- and user-specific
scripts in e.g. ~/.Xsession (or its older sibling ~/.Xsessionrc)).

See "man Xsession" and the scripts in /etc/X11/Xsession* -- they
are shell scripts and might inspire you.


No mention of path there.



With the advent of desktop environments things have become
a bit more complex, but I'm the wrong person for that: I just
fled the DE craze ten years ago.

Cheers
-- tomás







Re: Setting default $PATH for all users

2019-02-08 Thread tomas
On Fri, Feb 08, 2019 at 08:22:54AM -0500, Roberto C. Sánchez wrote:
> On Fri, Feb 08, 2019 at 07:18:39AM -0600, Richard Owlett wrote:
> > I'm running Debian Stretch with MATE desktop.
> > I want the current user and all future users to include all directories in
> > root's $PATH.
> > 
> > I haven't found a definitive answer in my web search. The answer's seem to
> > depend on which Linux is used and multiple parameters.
> > 
> As with most things in Linux and Unix, it depends.
> 
> Some likely candidates are /etc/bash.bashrc, /etc/profile,
> /etc/profile.d/, and /etc/environment.

More background: processes inherit their environment from their
parent process, and so on.

Since most of your (user) environment doesn't make sense for
system daemons (what is Apache to do with LS_COLORS? But also
arguably PATH shouldn't be there, or should, at least, be
ignored), there are "checkpoints" at which the (user) environment
can be set.

Traditionally that happens at login (/etc/profile, ~/.profile
and all their shell-specific variations -- sometimes you want
slightly different environments for different shells).

But X. When X came up, a similar mechanism was introduced, to
let programs started directly from X also have nice environments:
That is where Xsession (of which there are system-wide scripts
in (Debian, at least) /etc/X11/Xsession, typically broken up
in task-specific snippets in /etc/X11/Xsession.d -- and user-specific
scripts in e.g. ~/.Xsession (or its older sibling ~/.Xsessionrc)).

See "man Xsession" and the scripts in /etc/X11/Xsession* -- they
are shell scripts and might inspire you.

With the advent of desktop environments things have become
a bit more complex, but I'm the wrong person for that: I just
fled the DE craze ten years ago.

Cheers
-- tomás


signature.asc
Description: Digital signature


Re: Setting default $PATH for all users

2019-02-08 Thread Roberto C . Sánchez
On Fri, Feb 08, 2019 at 07:18:39AM -0600, Richard Owlett wrote:
> I'm running Debian Stretch with MATE desktop.
> I want the current user and all future users to include all directories in
> root's $PATH.
> 
> I haven't found a definitive answer in my web search. The answer's seem to
> depend on which Linux is used and multiple parameters.
> 
As with most things in Linux and Unix, it depends.

Some likely candidates are /etc/bash.bashrc, /etc/profile,
/etc/profile.d/, and /etc/environment.

Regards,

-Roberto

-- 
Roberto C. Sánchez



Setting default $PATH for all users

2019-02-08 Thread Richard Owlett

I'm running Debian Stretch with MATE desktop.
I want the current user and all future users to include all directories 
in root's $PATH.


I haven't found a definitive answer in my web search. The answer's seem 
to depend on which Linux is used and multiple parameters.


TIA