Debian This forum is for the discussion of Debian Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
03-08-2006, 09:35 PM
|
#1
|
Member
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208
Rep:
|
Why is the value of $PATH in console mode different from the $PATH in xterm emulator?
When in console mode (x-window-system is not loaded),
root@myserver:~#echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
However, when I'm in the window manager (fluxbox) and I open a xterm window, my $PATH has a different value.
root@myserver:~#echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/ sbin:/bin:/usr/bin/X11
The difference is the additional space between the slash (/) and sbin. That causes /sbin to be missing from my PATH.
So any attempt to install package will give the error
dpkg: ldconfig not found on PATH
dpkg: start-stop-daemon not found on PATH
What is causing the additional space between the slash (/) and sbin in the PATH only when in xterm emulator?
Any advice would be greatly appreciated.
Thanks.
PS. Happens on both machines I installed x-window-system, fluxbox, xterm.
|
|
|
03-08-2006, 11:56 PM
|
#2
|
Member
Registered: Feb 2006
Location: Oklahoma
Distribution: Debian Sid and Etch
Posts: 423
Rep:
|
When you login the console /etc/profile is read. Opening an xterm only reads /etc/bash.bashrc, ~/.bashrc.
|
|
|
03-09-2006, 03:13 AM
|
#3
|
Member
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208
Original Poster
Rep:
|
For testing purpose, I installed rxvt and eterm. rxvt has the same error but eterm displays the correct $PATH value ( no extra space ).
In short, $PATH shows the correct value in eterm, but incorrect in rxvt and xterm on both machines.
Thanks !
|
|
|
03-09-2006, 03:26 AM
|
#4
|
Senior Member
Registered: Feb 2004
Location: Middle of nowhere
Distribution: Debian Squeeze
Posts: 1,249
Rep:
|
Quote:
Originally Posted by Akhran
When in console mode (x-window-system is not loaded),
root@myserver:~#echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
However, when I'm in the window manager (fluxbox) and I open a xterm window, my $PATH has a different value.
root@myserver:~#echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/ sbin:/bin:/usr/bin/X11
The difference is the additional space between the slash (/) and sbin. That causes /sbin to be missing from my PATH.
So any attempt to install package will give the error
dpkg: ldconfig not found on PATH
dpkg: start-stop-daemon not found on PATH
What is causing the additional space between the slash (/) and sbin in the PATH only when in xterm emulator?
Any advice would be greatly appreciated.
Thanks.
PS. Happens on both machines I installed x-window-sy
stem, fluxbox, xterm.
|
I had the exact same problem couple of days ago. I added the line
source /etc/profile in my ~/.bashrc file.
Also, how do the following files work in the sense when and how are they called and by whom?
Code:
.bash_profile,.bashrc, .profile, /etc/profile, /etc/bash.bashrc, .xsesson and .xinitrc
If someone can clarify those it would be really great.
|
|
|
03-09-2006, 03:31 AM
|
#5
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
Yes that's pretty annoying all this differences. Standards would help.. (maybe dash follows)
I add this type of line in scripts when I don't know when they're called.
Code:
echo "In bashrc" | logger

|
|
|
03-09-2006, 04:20 AM
|
#6
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep: 
|
The first few describe bash's use of the files, because that's what I'm used to. My apologies to users of other shells...
Code:
.bash_profile read by the bash shell every time you login to the system (ie only in login shells);
.bashrc is read by the bash shell every time you open a subshell with the bash command;
.profile is used by the bash shell as a synonym for .bash_profile (derived from bourne and korn shells);
/etc/profile is a system-wide 'parent' of .bash_profile/.profile;
/etc/bashrc is a system-wide 'parent' of .bashrc <= I've never used this one...
.xinitrc is a script that gets run every time startx is executed;
.xsession is executed when users log in using xdm (.xinitrc is ignored)
|
|
|
03-09-2006, 08:42 AM
|
#7
|
Member
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208
Original Poster
Rep:
|
What's the difference between xterm, eterm and rxvt in terms of implementation that might have caused this difference? As far as I can notice, /etc/profile is the only place where my $PATH is defined.
Quote:
Originally Posted by Akhran
For testing purpose, I installed rxvt and eterm. rxvt has the same error but eterm displays the correct $PATH value ( no extra space ).
In short, $PATH shows the correct value in eterm, but incorrect in rxvt and xterm on both machines.
Thanks !
|
|
|
|
03-09-2006, 08:53 AM
|
#8
|
Member
Registered: Feb 2006
Location: Oklahoma
Distribution: Debian Sid and Etch
Posts: 423
Rep:
|
Use these to track down the problem
grep -r 'PATH=' /root
grep -r 'PATH=' /etc
|
|
|
03-09-2006, 04:42 PM
|
#9
|
Member
Registered: Aug 2005
Distribution: Debian 'lenny'
Posts: 208
Original Poster
Rep:
|
No file under /root but lots under /etc with 'PATH='. Eyeball check seems to indicate none of the lines in /etc contain '/ sbin'. What is the correct syntax to use to grep PATH="some_path_here:/ sbin:more_path_here" (with a space between / and sbin).
Also, another point to consider is why only eterm is not affected.
Thanks for all the replies
Quote:
Originally Posted by dracae
Use these to track down the problem
grep -r 'PATH=' /root
grep -r 'PATH=' /etc
|
|
|
|
03-09-2006, 06:10 PM
|
#10
|
Member
Registered: Feb 2006
Location: Oklahoma
Distribution: Debian Sid and Etch
Posts: 423
Rep:
|
grep -r '/ sbin' /
|
|
|
All times are GMT -5. The time now is 10:16 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|