LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-02-2005, 12:32 PM   #1
jimi2012
LQ Newbie
 
Registered: Mar 2005
Posts: 24

Rep: Reputation: 15
xorgconfig not working as "root"


Hey! I ama going crazzy here. I did a fresh slackware 10.1 installation. My mouse was not working, so I try to run xorgconfig as root, but it tells me "command not found"!! When I login as regular user, it pulls up just fine, but then it saves the xorgconfig file in "my documents" instead of /etc/x11

can anybody shed some light on this?

grazias!~
 
Old 10-02-2005, 12:33 PM   #2
jimi2012
LQ Newbie
 
Registered: Mar 2005
Posts: 24

Original Poster
Rep: Reputation: 15
and why isit that when I open xorgconfig with pico that there is nothing inside??WTF??
 
Old 10-02-2005, 04:50 PM   #3
koodoo
Member
 
Registered: Aug 2004
Location: a small village faraway in the mountains
Distribution: Fedora Core 1, Slackware 10.0 | 2.4.26 | custom 2.6.14.2, Slackware 10.2 | 11.0, Slackware64-13
Posts: 345

Rep: Reputation: 32
Quote:
Originally posted by jimi2012
and why isit that when I open xorgconfig with pico that there is nothing inside??WTF??
How do you open xorgconfig with pico. I mean which command do you try. I bet you did something like :
Code:
koodoo@knapsacker:~$ pico xorgconfig
Well what that does is that it looks for a file called xorgconfig in the current directory and opens it. If it does not find one it opens a new file by that name.

To open the xorgconfig file try :
Code:
koodoo@knapsacker:~$ pico /<full path to>/xorgconfig
You can find the full path to xorgconfig by the which command. Here is what I get on my system :
Code:
koodoo@knapsacker:~$ which xorgconfig
/usr/X11R6/bin/xorgconfig
koodoo@knapsacker:~$
So to open it you would like to try something like :
Code:
koodoo@knapsacker:~$ pico /usr/X11R6/bin/xorgconfig
koodoo@knapsacker:~$
BTW why do you wish to open the xorgconfig file, it's an executable file, it contains all binary data. I don't think it'll serve any good.

As for your original question.
I guess you login as a normal user and then type su and then enter the password to gain root privileges. Now when you type the command xorgconfig you get "command not found"
Try this : logout completely and then login as the root user and then try the xorgconfig command.

or an even more simpler solution. Login as a normal user and :
Code:
koodoo@knapsacker:~$ su
Password:
root@knapsacker:/home/koodoo# /usr/X11R6/bin/xorgconfig
and you're done !

Now why does it in the first place say command not found. It has to do with how bash or any shell is invoked and what configuration files it reads and how it sets up it's environmental variables. There is a difference between a login shell and a non-login shell an interactive shell and a non-interactive shell. Try man bash and see for yourself. I cannot provide more explanations because I still have some doubts.
Though I can provide some pointers. Whenever a user types in a command name (just the command name and not the complete path to it) the shell searches for the program in a predefined set of directories as defined by the $PATH variable. Take a look at the $PATH variable in the different cases that arise.
as a normal user :
Code:
koodoo@knapsacker:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin:.
or
Code:
koodoo@knapsacker:~$ su
Password:
root@knapsacker:/home/koodoo# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/bin:/usr/bin
root@knapsacker:/home/koodoo#
or if you logout completely and then login as the root user :
Code:
/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/games:/opt/www/htdig/bin:/usr/lib/java/bin:/usr/lib/java/jre/bin:/opt/kde/bin:/usr/lib/qt/bin:/usr/share/texmf/bin
As indicated earlier by the which command the xorgconfig is located in /usr/X11R6/bin/ This is included in the standard search path in the first and the last case, but in the second case it isn't so you see the shell doesn't search for the program in /usr/X11R6/bin/ and not finding it in the standard search path says "command not found" You can however still specify the complete path yourself to execute the command as in :
Code:
koodoo@knapsacker:~$ su
Password:
root@knapsacker:/home/koodoo# /usr/X11R6/bin/xorgconfig
You could also do something like this : Run xorgconfig as a normal user and save the xorg.conf file in the user's directory. Then as root copy/move the file over to the /etc/X11/ directory.
PS : Make sure you backup your old xorg.conf file before you overwrite it with the new one. Just in case.....


Hope this helps !

Last edited by koodoo; 10-02-2005 at 04:58 PM.
 
Old 10-02-2005, 05:03 PM   #4
koodoo
Member
 
Registered: Aug 2004
Location: a small village faraway in the mountains
Distribution: Fedora Core 1, Slackware 10.0 | 2.4.26 | custom 2.6.14.2, Slackware 10.2 | 11.0, Slackware64-13
Posts: 345

Rep: Reputation: 32
Hey, just wanted to add something more. Thought this might clear some doubts.
xorgconfig is a program used for configuring the X server. It is not a configuration file It is an executable file. This file generates a configuration file called xorg.conf for the X server to look for it's configurations. The xorg.conf file is stored in the /etc/X11/ directory. So you might want to try something like :

Code:
koodoo@knapsacker:~$ pico /etc/X11/xorg.conf
 
Old 10-02-2005, 06:53 PM   #5
otchie1
Registered User
 
Registered: Apr 2004
Posts: 560

Rep: Reputation: 30
or the short answer, as root
Code:
./xorgconfig
:-)
 
Old 10-02-2005, 06:57 PM   #6
freakyg
Member
 
Registered: Apr 2005
Distribution: LFS 5.0 and 6.1
Posts: 705

Rep: Reputation: 30
since when does Slackware install pico......??
use the default............vi
 
Old 10-02-2005, 07:10 PM   #7
koodoo
Member
 
Registered: Aug 2004
Location: a small village faraway in the mountains
Distribution: Fedora Core 1, Slackware 10.0 | 2.4.26 | custom 2.6.14.2, Slackware 10.2 | 11.0, Slackware64-13
Posts: 345

Rep: Reputation: 32
Quote:
Originally posted by otchie1
or the short answer, as root
Code:
./xorgconfig
:-)
Sorry I didn't quite get what you were trying to say.
" ./ " refers to the current directory. So doing ./xorgconfig would search for xorgconfig only in the current directory. That wouldn't work !

You could however do something like :
Code:
koodoo@knapsacker:~$ cd /usr/X11R6/bin/
koodoo@knapsacker:/usr/X11R6/bin$ su
Password:
root@knapsacker:/usr/X11R6/bin# ./xorgconfig
If you were bent on using " ./ " but I guess that wouldn't be quite elegant, would it ?

Quote:
Originally posted by freakyg
since when does Slackware install pico......??
I am currently using Slackware 10.0 and it has Pico 4.7 bundled with it !
 
Old 10-03-2005, 07:22 AM   #8
otchie1
Registered User
 
Registered: Apr 2004
Posts: 560

Rep: Reputation: 30
Then I'll amend my short answer to,

as root
Code:
cd /usr/X11R6/bin/
./xorgconfig
In my experience when people know enough to start talking about running xorgconfig from the command line but can't get it to work it's just beacuse the command is not in the path. Simple answers turn on more light bulbs than long ones.
 
Old 10-03-2005, 01:10 PM   #9
jimi2012
LQ Newbie
 
Registered: Mar 2005
Posts: 24

Original Poster
Rep: Reputation: 15
That certainly sheds some light on this. Thank you!
When I ran the "which xorgconfig"command as regular user, it finds it, but not as root, shouldn't it find it as well?
When I am in that directory and type xorgconfig, -command not found!
When I do ./ xorgconfig, it works!! I don't quite understand it, but, whatever...

The reason I need to run it is beacause my logitech cordless optical mouse is not working at all.
So, I was gonna make changes in the xorg.conf, instead now I ran xorgconfig again, but still no luck!
Instead my screen moved over to the right half an inch!!? and my fonts look all fuzzzy, even though I did not change those settings.
Anyways I need my mouse first!
I will post the xorg.conf in a minute
 
Old 10-03-2005, 01:21 PM   #10
jimi2012
LQ Newbie
 
Registered: Mar 2005
Posts: 24

Original Poster
Rep: Reputation: 15
Here is the xorg.conf: (there are 2 more xorg.conf-fbdev, and xorg.conf-vesa, I assume I don' need those)
Section "input device"

#Identifier and driver

Identifier "mouse1"
Driver "mouse"
Option "protocol" "IMPS/2"
Option "device" "dev/mouse"
 
Old 10-03-2005, 01:49 PM   #11
jimi2012
LQ Newbie
 
Registered: Mar 2005
Posts: 24

Original Poster
Rep: Reputation: 15
logitech mouse

Now I edidet xorg.conf to this:
Section "InputDevice"
Identifier "Mouse 1"
Driver "mouse"
Option "Protocol" "ImPS/2"
Option "Device" "/dev/input/mouse0"
Option "Buttons" "5"
Option "ZAxisMapping" "4 5"
EndSection

taken from: http://lists.freedesktop.org/archive...st/002384.html

Aaargh, ..still not working!
 
Old 10-04-2005, 12:55 AM   #12
jimi2012
LQ Newbie
 
Registered: Mar 2005
Posts: 24

Original Poster
Rep: Reputation: 15
nevermind!! I did a reinstall. it all works fine now!

Thank you!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
newbie question: whats the difference between "su root", "su" and "su -&quo mojarron Slackware 9 12-07-2009 04:08 PM
[Redhat] make "admin" account same privledges as "root" Bi0haZarD Linux - Networking 20 01-12-2005 10:47 AM
"startx" crashes entire system after xorgconfig is run sether Arch 7 11-16-2004 02:11 PM
bash command is Not working in "root" jchun Linux - Newbie 2 10-26-2004 01:27 PM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 03:28 PM


All times are GMT -5. The time now is 10:23 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration