You are not logged in.

#1 2009-11-17 02:26:33

pecenac
Member
Registered: 2009-09-27
Posts: 14

[SOLVED] wierd terminal behaviour

Hi

Ive just switched from kde to xfce and suddenly realised that some commands in terminal return Command not found. After playing around some, googeling, reinstalling etc. I go to the point when after opening terminal

alsactl

doesnt work. If I however do su - root, run alsactl then do su username and try again it works. su (without -) does not work either. Example:

[pecenac@pecenac-laptop ~]$ alsactl
bash: alsactl: command not found
[pecenac@pecenac-laptop ~]$ sudo alsactl
Password: 
sudo: alsactl: command not found
[pecenac@pecenac-laptop ~]$ su root
Password: 
[root@pecenac-laptop pecenac]# alsactl
bash: alsactl: command not found
[root@pecenac-laptop pecenac]# su - root
[root@pecenac-laptop ~]# alsactl
alsactl: Specify command...
[root@pecenac-laptop ~]# su pecenac
[pecenac@pecenac-laptop root]$ alsactl
alsactl: Specify command...
[pecenac@pecenac-laptop root]$

I used alsactl as an example but it does ti for other commands as well. Seems like it affects commands from sbin. This only happens in terminal, if I do ctrl+alt+F1 it works fine. Thanks

Last edited by pecenac (2009-11-18 05:56:19)

Offline

#2 2009-11-17 03:23:54

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [SOLVED] wierd terminal behaviour

Apparently sbin isn't in your path. There are many ways to add it.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#3 2009-11-17 04:44:21

pecenac
Member
Registered: 2009-09-27
Posts: 14

Re: [SOLVED] wierd terminal behaviour

Thanks. Im not sure if that is it. If sbin is not in my path how come the commnds work after switchng to root and then back? I did take a look at the .bashrc and .bash-profile and they look exactly the same as those belonging to another user for whom the commands work. Is there any other file that might affect the path inclusion? Also how come I can use the commands from tty1, but not from terminal under xfce? My etc/profile does include:

# Set our default path
PATH="/bin:/usr/bin:/sbin:/usr/sbin"
export PATH

so that should be OK. Im pretty confused.

Last edited by pecenac (2009-11-17 04:44:38)

Offline

#4 2009-11-17 07:31:33

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] wierd terminal behaviour

Try typing

echo $PATH

in your terminal as you, before doing the su stuff, and then again afterwards.

With the dot files, sometimes ones that can look the same can have a slight typo that's hard to spot, so it might be worth listing those here (in code tags, please).


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#5 2009-11-17 10:04:42

grey
Member
From: Europe
Registered: 2007-08-23
Posts: 679

Re: [SOLVED] wierd terminal behaviour

It actually makes sense: su - root gives you a login shell, su <yourname> (without '-') doesn't, so after executing the two commands you will have inherited some of root's environment settings.


Good ideas do not need lots of lies told about them in order to gain public acceptance.

Offline

#6 2009-11-17 14:41:07

pecenac
Member
Registered: 2009-09-27
Posts: 14

Re: [SOLVED] wierd terminal behaviour

Thanks a lot. I needed to get going so I tried to back trace my actions and voila, after switching from slim to gdm it solved itself. I cant really try the above mentioned suggestions at this point, but Ill try it again. I would prefer to use slim over gdm so ill get back on it as soon as I find the time. Thank your the replies.

Offline

#7 2009-11-17 15:26:55

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] wierd terminal behaviour

Check your /etc/slim.conf file, specifically the "login_cmd". If it doesn't start bash with the --login option, that may be (part of) the problem. I recommend reading the INVOCATION  section of the bash man page, as that describes what gets executed when.

Different people set bash up differently and which files exist or get called can very quite a bit. Thus it's best to know that stuff (or be aware of it and know where to look it up). There are pros and cons of most approaches.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#8 2009-11-18 05:58:25

pecenac
Member
Registered: 2009-09-27
Posts: 14

Re: [SOLVED] wierd terminal behaviour

As with most things the answer was there all along. In the begingin of the slim.conf one has to define default path. It is not enough to comment this ine out, it has to be set to correct value. I just copied there the path from etc/profile. Thanks to everybody for your answers and time.

Offline

Board footer

Powered by FluxBB