[opensuse-support] Is $HOME/bin added by default to $PATH?
Hi, I am having trouble understanding whether $HOME/bin should automatically be added to $PATH or if I should add it myself in $HOME/.bashrc. I recall this was working out of the box at some point but now it does not. I looked in /etc/skel and /etc/profile.d but did not find any indication that it should be set. Is $HOME/bin added by default to $PATH? Thanks, Robert -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
* Robert Munteanu
Hi,
I am having trouble understanding whether $HOME/bin should automatically be added to $PATH or if I should add it myself in $HOME/.bashrc. I recall this was working out of the box at some point but now it does not.
I looked in /etc/skel and /etc/profile.d but did not find any indication that it should be set.
Is $HOME/bin added by default to $PATH?
make a new <user> issue: echo $PATH does /home/<user>/bin appear at the front of the output from "echo $PATH"? you have your answer -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
Hi, On Fri, 2019-11-01 at 10:36 -0400, Patrick Shanahan wrote:
* Robert Munteanu
[11-01-19 10:26]: Hi,
I am having trouble understanding whether $HOME/bin should automatically be added to $PATH or if I should add it myself in $HOME/.bashrc. I recall this was working out of the box at some point but now it does not.
I looked in /etc/skel and /etc/profile.d but did not find any indication that it should be set.
Is $HOME/bin added by default to $PATH?
make a new <user> issue: echo $PATH
does /home/<user>/bin appear at the front of the output from "echo $PATH"?
Yes, it does. If I sudo as that user. In fact, the pattern is: - open gnome-terminal/tilix/xterm - echo $PATH /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin - sudo su - $USER ( or sudo su $USER ) - echo $PATH /home/robert/bin:/usr/local/bin:/usr/bin:/bin Where is the difference coming from? Thanks, Robert -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
* Robert Munteanu
Hi,
On Fri, 2019-11-01 at 10:36 -0400, Patrick Shanahan wrote:
* Robert Munteanu
[11-01-19 10:26]: Hi,
I am having trouble understanding whether $HOME/bin should automatically be added to $PATH or if I should add it myself in $HOME/.bashrc. I recall this was working out of the box at some point but now it does not.
I looked in /etc/skel and /etc/profile.d but did not find any indication that it should be set.
Is $HOME/bin added by default to $PATH?
make a new <user> issue: echo $PATH
does /home/<user>/bin appear at the front of the output from "echo $PATH"?
Yes, it does. If I sudo as that user. In fact, the pattern is:
- open gnome-terminal/tilix/xterm - echo $PATH /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X11R6/bin
- sudo su - $USER ( or sudo su $USER ) - echo $PATH /home/robert/bin:/usr/local/bin:/usr/bin:/bin
Where is the difference coming from?
again: before you "sudo", try "echo $USER" if the output is robert, you are only sudo(ing) into your own and present account, not a new user or different user. useradd <newuser> sudo <newuser> echo $PATH userdel <newuser> does /home/<newuser>/bin appear at front of $PATH -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
On Fri, 2019-11-01 at 10:49 -0400, Patrick Shanahan wrote:
* Robert Munteanu
[11-01-19 10:41]: Hi,
On Fri, 2019-11-01 at 10:36 -0400, Patrick Shanahan wrote:
* Robert Munteanu
[11-01-19 10:26]: Hi,
I am having trouble understanding whether $HOME/bin should automatically be added to $PATH or if I should add it myself in $HOME/.bashrc. I recall this was working out of the box at some point but now it does not.
I looked in /etc/skel and /etc/profile.d but did not find any indication that it should be set.
Is $HOME/bin added by default to $PATH?
make a new <user> issue: echo $PATH
does /home/<user>/bin appear at the front of the output from "echo $PATH"?
Yes, it does. If I sudo as that user. In fact, the pattern is:
- open gnome-terminal/tilix/xterm - echo $PATH /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X 11R6/bin
- sudo su - $USER ( or sudo su $USER ) - echo $PATH /home/robert/bin:/usr/local/bin:/usr/bin:/bin
Where is the difference coming from?
again: before you "sudo", try "echo $USER" if the output is robert, you are only sudo(ing) into your own and present account, not a new user or different user.
useradd <newuser> sudo <newuser> echo $PATH userdel <newuser>
does /home/<newuser>/bin appear at front of $PATH
Regarding your immediate question: $ sudo useradd -m test $ sudo su - test $ echo $USER,$PATH test,/home/test/bin:/usr/local/bin:/usr/bin:/bin $ sudo userdel -r test So for that user the path is correctly set. The same stands true for my own user as well, but only when using `sudo su -` or `sudo su` . Note that $USER is unchanged as points to the current user. $ echo $USER,$PATH robert,/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/us r/X11R6/bin $ sudo su - $USER $ echo $USER,$PATH robert,/home/robert/bin:/usr/local/bin:/usr/bin:/bin So this is not about a new user vs existing ones, it's about how login is achieved. I get the path that does not include $HOME/bin by: - logging in to tty1 - using xterm - using gnome-terminal - using tilix So there's a clear difference how the paths are setup. Digging further, I see some path work being done in /etc/profile: if test -z "$PROFILEREAD" ; then PATH=/usr/local/bin:/usr/bin:/bin if test "$HOME" != "/" ; then for dir in $HOME/bin/$CPU $HOME/bin ; do test -d $dir && PATH=$dir:$PATH done fi (snip) But not sure why it does not work in my case. Thanks, Robert -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
* Robert Munteanu
On Fri, 2019-11-01 at 10:49 -0400, Patrick Shanahan wrote:
* Robert Munteanu
[11-01-19 10:41]: Hi,
On Fri, 2019-11-01 at 10:36 -0400, Patrick Shanahan wrote:
* Robert Munteanu
[11-01-19 10:26]: Hi,
I am having trouble understanding whether $HOME/bin should automatically be added to $PATH or if I should add it myself in $HOME/.bashrc. I recall this was working out of the box at some point but now it does not.
I looked in /etc/skel and /etc/profile.d but did not find any indication that it should be set.
Is $HOME/bin added by default to $PATH?
make a new <user> issue: echo $PATH
does /home/<user>/bin appear at the front of the output from "echo $PATH"?
Yes, it does. If I sudo as that user. In fact, the pattern is:
- open gnome-terminal/tilix/xterm - echo $PATH /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X 11R6/bin
- sudo su - $USER ( or sudo su $USER ) - echo $PATH /home/robert/bin:/usr/local/bin:/usr/bin:/bin
Where is the difference coming from?
again: before you "sudo", try "echo $USER" if the output is robert, you are only sudo(ing) into your own and present account, not a new user or different user.
useradd <newuser> sudo <newuser> echo $PATH userdel <newuser>
does /home/<newuser>/bin appear at front of $PATH
Regarding your immediate question:
$ sudo useradd -m test $ sudo su - test $ echo $USER,$PATH test,/home/test/bin:/usr/local/bin:/usr/bin:/bin $ sudo userdel -r test
So for that user the path is correctly set. The same stands true for my own user as well, but only when using `sudo su -` or `sudo su` . Note that $USER is unchanged as points to the current user.
$ echo $USER,$PATH robert,/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/us r/X11R6/bin $ sudo su - $USER $ echo $USER,$PATH robert,/home/robert/bin:/usr/local/bin:/usr/bin:/bin
So this is not about a new user vs existing ones, it's about how login is achieved. I get the path that does not include $HOME/bin by:
- logging in to tty1 - using xterm - using gnome-terminal - using tilix
So there's a clear difference how the paths are setup. Digging further, I see some path work being done in /etc/profile:
if test -z "$PROFILEREAD" ; then PATH=/usr/local/bin:/usr/bin:/bin if test "$HOME" != "/" ; then for dir in $HOME/bin/$CPU $HOME/bin ; do test -d $dir && PATH=$dir:$PATH done fi
(snip)
But not sure why it does not work in my case.
it is explained in "man sudo". if you (aiui): sudo $USER you do not inherit $USER's environment which includes $PATH. if you: sudo - $USER you do and $PATH should be the same and what $USER sees, ie: what $USER has in his environment. -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 01/11/2019 16.25, Robert Munteanu wrote:
On Fri, 2019-11-01 at 10:49 -0400, Patrick Shanahan wrote:
* Robert Munteanu <> [11-01-19 10:41]:
Hi,
On Fri, 2019-11-01 at 10:36 -0400, Patrick Shanahan wrote:
* Robert Munteanu <> [11-01-19 10:26]:
make a new <user> issue: echo $PATH
does /home/<user>/bin appear at the front of the output from "echo $PATH"?
Yes, it does. If I sudo as that user. In fact, the pattern is:
sudo doesn't prove it.
- open gnome-terminal/tilix/xterm - echo $PATH /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X
11R6/bin
- sudo su - $USER ( or sudo su $USER ) - echo $PATH /home/robert/bin:/usr/local/bin:/usr/bin:/bin
Where is the difference coming from?
again: before you "sudo", try "echo $USER" if the output is robert, you are only sudo(ing) into your own and present account, not a new user or different user.
useradd <newuser> sudo <newuser> echo $PATH userdel <newuser>
does /home/<newuser>/bin appear at front of $PATH
Regarding your immediate question:
$ sudo useradd -m test $ sudo su - test
We do "su - test", leave out the sudo. This is not Ubuntu. Do instead: su - useradd -m test su - test echo $USER,$PATH - -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXbyj4AAKCRC1MxgcbY1H 1brSAJoCJURzWwFqts/flxv/nX2bdI4p/gCfQoQkXGLfFgMI00UwR2cXm/oId+k= =eJ6O -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
* Carlos E. R.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 01/11/2019 16.25, Robert Munteanu wrote:
On Fri, 2019-11-01 at 10:49 -0400, Patrick Shanahan wrote:
* Robert Munteanu <> [11-01-19 10:41]:
Hi,
On Fri, 2019-11-01 at 10:36 -0400, Patrick Shanahan wrote:
* Robert Munteanu <> [11-01-19 10:26]:
make a new <user> issue: echo $PATH
does /home/<user>/bin appear at the front of the output from "echo $PATH"?
Yes, it does. If I sudo as that user. In fact, the pattern is:
sudo doesn't prove it.
- open gnome-terminal/tilix/xterm - echo $PATH /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X
11R6/bin
- sudo su - $USER ( or sudo su $USER ) - echo $PATH /home/robert/bin:/usr/local/bin:/usr/bin:/bin
Where is the difference coming from?
again: before you "sudo", try "echo $USER" if the output is robert, you are only sudo(ing) into your own and present account, not a new user or different user.
useradd <newuser> sudo <newuser> echo $PATH userdel <newuser>
does /home/<newuser>/bin appear at front of $PATH
Regarding your immediate question:
$ sudo useradd -m test $ sudo su - test
We do "su - test", leave out the sudo. This is not Ubuntu.
Do instead:
su - useradd -m test su - test echo $USER,$PATH
agreed. I seldom utilize sudo, preferring "su - <someuser> and the dash following su provides the environment from <someuser> -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
On Fri, 1 Nov 2019 20:43:49 -0400
Patrick Shanahan
* Carlos E. R.
[11-01-19 17:31]: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 01/11/2019 16.25, Robert Munteanu wrote:
On Fri, 2019-11-01 at 10:49 -0400, Patrick Shanahan wrote:
* Robert Munteanu <> [11-01-19 10:41]:
Hi,
On Fri, 2019-11-01 at 10:36 -0400, Patrick Shanahan wrote:
* Robert Munteanu <> [11-01-19 10:26]:
make a new <user> issue: echo $PATH
does /home/<user>/bin appear at the front of the output from "echo $PATH"?
Yes, it does. If I sudo as that user. In fact, the pattern is:
sudo doesn't prove it.
- open gnome-terminal/tilix/xterm - echo $PATH /usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/X
11R6/bin
- sudo su - $USER ( or sudo su $USER ) - echo $PATH /home/robert/bin:/usr/local/bin:/usr/bin:/bin
Where is the difference coming from?
again: before you "sudo", try "echo $USER" if the output is robert, you are only sudo(ing) into your own and present account, not a new user or different user.
useradd <newuser> sudo <newuser> echo $PATH userdel <newuser>
does /home/<newuser>/bin appear at front of $PATH
Regarding your immediate question:
$ sudo useradd -m test $ sudo su - test
We do "su - test", leave out the sudo. This is not Ubuntu.
Do instead:
su - useradd -m test su - test echo $USER,$PATH
agreed. I seldom utilize sudo, preferring "su - <someuser> and the dash following su provides the environment from <someuser>
I normally keep a root session open as well as one for my user, purely in the interests of convenience (and laziness :) but if I was thinking about security, I would use sudo for root access. Thus: sudo useradd -m test su - test echo $USER,$PATH The reason being that sudo just grants authority for the one command that follows it. Using su - starts an open root session, and using su - test afterwards doesn't close it. The root session is still there and can be accessed just by typing CTRL-D, so somebody could do whatever nefarious activity they wanted and then hide it by typing su - test again. -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 02/11/2019 11.55, Dave Howorth wrote:
On Fri, 1 Nov 2019 20:43:49 -0400 Patrick Shanahan
wrote: * Carlos E. R. <> [11-01-19 17:31]:
On 01/11/2019 16.25, Robert Munteanu wrote:
...
We do "su - test", leave out the sudo. This is not Ubuntu.
Do instead:
su - useradd -m test su - test echo $USER,$PATH
agreed. I seldom utilize sudo, preferring "su - <someuser> and the dash following su provides the environment from <someuser>
I normally keep a root session open as well as one for my user, purely in the interests of convenience (and laziness :) but if I was thinking about security, I would use sudo for root access. Thus:
sudo useradd -m test su - test echo $USER,$PATH
The reason being that sudo just grants authority for the one command that follows it. Using su - starts an open root session, and using su - test afterwards doesn't close it. The root session is still there and can be accessed just by typing CTRL-D, so somebody could do whatever nefarious activity they wanted and then hide it by typing su - test again.
Then: su - useradd -m test exit su - test echo $USER,$PATH In my setup, you can not do "sudo anything", only "sudo specific_command". And the user doesn't get to know the root password. - -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar) -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCXb1jCQAKCRC1MxgcbY1H 1Z4xAJ9XpDHPpeXSxLqEVwQkdQsHqUp2AQCfWyq3PaD/b+iOsC05v3HjvlQQI58= =CGmm -----END PGP SIGNATURE----- -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
Carlos, Patrick, Dave, et al --
...and then Dave Howorth said...
%
% On Fri, 1 Nov 2019 20:43:49 -0400
% Patrick Shanahan
On 05/11/2019 04.43, David T-G wrote:
Carlos, Patrick, Dave, et al --
...and then Dave Howorth said... % % On Fri, 1 Nov 2019 20:43:49 -0400 % Patrick Shanahan
wrote: % % > * Carlos E. R. [11-01-19 17:31]: ... % > > We do "su - test", leave out the sudo. This is not Ubuntu. % > > What's with Ubuntu? I was using sudo on SunOS back in the early 90s. It's worlds ahead of basic su.
Not the Ubuntu way :-)
... % > agreed. I seldom utilize sudo, preferring "su - <someuser> and the % > dash following su provides the environment from <someuser>
Why would you prefer su when you could just
sudo -i -u <someuser>
to start a login (-i) shell more securely?
Why wold it be more secure?
% ... % The reason being that sudo just grants authority for the one command % that follows it. Using su - starts an open root session, and using su - % test afterwards doesn't close it. The root session is still there and
So would
sudo -i sudo -iu root
and more securely.
In addition to providing granular control of what a user may & may not do and logging all activity and not revealing the root password,
Ah! But you see, the way sudo is configured in those machines (ie, not configured at all), the user using sudo can do absolutely everything, he is not restricted at all. And about not revealing the root password, remember that the users we are talking about are also the administrators of the machine and the owners of the machine, so of course they know the root password. In fact, in openSUSE, the password you type when using sudo is the root password.
sudo is simply more secure because instead of having to execute a command as root
sudo su - <user>
one simply executes a command in your context
sudo -iu <user>
to become that account (if allowed, of course). Even if you know the root password, you shouldn't be using it on a daily basis, using instead sudo to gain those privileges when & as needed.
Why? -- Cheers / Saludos, Carlos E. R. (from 15.1 x86_64 at Telcontar)
Robert, et al -- ...and then Robert Munteanu said... % ... % So this is not about a new user vs existing ones, it's about how login % is achieved. I get the path that does not include $HOME/bin by: % % - logging in to tty1 This surprises me, since it is IS an actual login and will read your profile. % - using xterm % - using gnome-terminal % - using tilix These are likely not login shells but rather just shells, and so they won't read profile and do the fun stuff in there. % % So there's a clear difference how the paths are setup. Digging further, % I see some path work being done in /etc/profile: % % if test -z "$PROFILEREAD" ; then Here's an interesting twist. If the variable indicating that you've already been through profile is empty then go ahead and do the next stuff, but don't repeat it. % PATH=/usr/local/bin:/usr/bin:/bin % if test "$HOME" != "/" ; then % for dir in $HOME/bin/$CPU $HOME/bin ; do % test -d $dir && PATH=$dir:$PATH It shouldn't be a factor in this case, since $PATH should be exported and inherited, but other things may not really happen when you think they would. % done % fi % % (snip) % % But not sure why it does not work in my case. Login vs just a shell. % % Thanks, % Robert HTH & HAND :-D -- David T-G See http://justpickone.org/davidtg/email/ See http://justpickone.org/davidtg/tofu.txt -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
On 11/5/19 2:04 PM, David T-G wrote:
Robert, et al --
...and then Robert Munteanu said... % ... % So this is not about a new user vs existing ones, it's about how login % is achieved. I get the path that does not include $HOME/bin by: % % - logging in to tty1
This surprises me, since it is IS an actual login and will read your profile.
% - using xterm % - using gnome-terminal % - using tilix
These are likely not login shells but rather just shells, and so they won't read profile and do the fun stuff in there.
Well technically these are terminal emulators and not shells, shells are bash, zsh fish etc
% % So there's a clear difference how the paths are setup. Digging further, % I see some path work being done in /etc/profile: % % if test -z "$PROFILEREAD" ; then
Here's an interesting twist. If the variable indicating that you've already been through profile is empty then go ahead and do the next stuff, but don't repeat it.
% PATH=/usr/local/bin:/usr/bin:/bin % if test "$HOME" != "/" ; then % for dir in $HOME/bin/$CPU $HOME/bin ; do % test -d $dir && PATH=$dir:$PATH
It shouldn't be a factor in this case, since $PATH should be exported and inherited, but other things may not really happen when you think they would.
% done % fi % % (snip) % % But not sure why it does not work in my case.
Login vs just a shell.
% % Thanks, % Robert
HTH & HAND
:-D
-- Simon Lees (Simotek) http://simotek.net Emergency Update Team keybase.io/simotek SUSE Linux Adelaide Australia, UTC+10:30 GPG Fingerprint: 5B87 DB9D 88DC F606 E489 CEC5 0922 C246 02F0 014B
Simon, et al -- ...and then Simon Lees said... % % On 11/5/19 2:04 PM, David T-G wrote: % > % > ...and then Robert Munteanu said... % > % ... % > % - using xterm % > % - using gnome-terminal % > % - using tilix % > % > These are likely not login shells but rather just shells, and so they % > won't read profile and do the fun stuff in there. % % Well technically these are terminal emulators and not shells, shells are % bash, zsh fish etc [snip] Touche' :-) I didn't want to complicate matters in my reply since he apparently was confused regarding how profile is sourced, but I quite agree. I probably should have said These are likely not RUNNING login shells ... (emphasis mine) to be more clear. HAND :-D -- David T-G See http://justpickone.org/davidtg/email/ See http://justpickone.org/davidtg/tofu.txt -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
(note: this works again without my intervention, no idea why. Still replying for the sake of being complete). On Mon, 2019-11-04 at 22:34 -0500, David T-G wrote:
Robert, et al --
...and then Robert Munteanu said... % ... % So this is not about a new user vs existing ones, it's about how login % is achieved. I get the path that does not include $HOME/bin by: % % - logging in to tty1
This surprises me, since it is IS an actual login and will read your profile.
Yes, that is quite surprising to me.
% - using xterm % - using gnome-terminal % - using tilix
These are likely not login shells but rather just shells, and so they won't read profile and do the fun stuff in there.
robert 26632 2941 15 15:42 ? 00:00:00 tilix robert 26641 26632 0 15:42 pts/1 00:00:00 -/bin/bash robert 26688 26641 0 15:42 pts/1 00:00:00 ps -efH robert 26689 26641 0 15:42 pts/1 00:00:00 less Tilix is starting up a login shell. However, my expectation is that when I start a terminal emulator, it inherits whatever variables are set by the parent process. In theory, the 'root' parent process should have the. I noticed though that the parent process of the desktop session is /usr/lib/systemd/systemd --user and PATH is set to /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
% % So there's a clear difference how the paths are setup. Digging further, % I see some path work being done in /etc/profile: % % if test -z "$PROFILEREAD" ; then
Here's an interesting twist. If the variable indicating that you've already been through profile is empty then go ahead and do the next stuff, but don't repeat it.
That is correct. I expect it to be loaded at least once though, and it is ( checked by adding a `logger` invocation at the top ).
% PATH=/usr/local/bin:/usr/bin:/bin % if test "$HOME" != "/" ; then % for dir in $HOME/bin/$CPU $HOME/bin ; do % test -d $dir && PATH=$dir:$PATH
It shouldn't be a factor in this case, since $PATH should be exported and inherited, but other things may not really happen when you think they would.
FWIW, the path is there.
% done % fi % % (snip) % % But not sure why it does not work in my case.
Login vs just a shell.
I'll leave validating that for the next time this occurs ... Thanks, Robert -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org
On Fri, 01 Nov 2019, 15:36:39 +0100, Patrick Shanahan wrote:
* Robert Munteanu
[11-01-19 10:26]: Hi,
I am having trouble understanding whether $HOME/bin should automatically be added to $PATH or if I should add it myself in $HOME/.bashrc. I recall this was working out of the box at some point but now it does not.
I looked in /etc/skel and /etc/profile.d but did not find any indication that it should be set.
Is $HOME/bin added by default to $PATH?
make a new <user> issue: echo $PATH
does /home/<user>/bin appear at the front of the output from "echo $PATH"?
you have your answer
3. check that the directory exists; it won't get added (at least in the past), if it didn't exist at login time. Cheers. l8er manfred
W dniu 01.11.2019 o 15:26, Robert Munteanu pisze:
Hi,
I am having trouble understanding whether $HOME/bin should automatically be added to $PATH or if I should add it myself in $HOME/.bashrc. I recall this was working out of the box at some point but now it does not.
I looked in /etc/skel and /etc/profile.d but did not find any indication that it should be set.
Is $HOME/bin added by default to $PATH?
Thanks, Robert
Check /etc/profile. It adds $HOME/bin if it exists.
participants (9)
-
Adam Mizerski
-
Carlos E. R.
-
Carlos E.R.
-
Dave Howorth
-
David T-G
-
Manfred Hollstein
-
Patrick Shanahan
-
Robert Munteanu
-
Simon Lees