Click to See Complete Forum and Search --> : PATH vs. links


yvrich
12-19-2000, 01:39 PM
Okay, so I changed the default runlevel in my boot-up script to 1 instead of 2, so I arrive at the command line instead of getting sent into the GUI upon startup. (Aside: can't seem to get out of the GUI once in. Crtl-Alt-Backspace sends me to the graphical login prompt. Have to track down why.)

At the command line, I attempt to launch X by typing startx, only to be told there is no such thing. A quick check reveals that startx is in /usr/X11R6/bin/ which is not in my PATH.

No problem, there are two ways I could handle this. One is to make a link to startx in a directory that is in my PATH, such as /usr/bin/. The other is to add /usr/X11R6/bin/ to PATH.

I tried the first method, making a link to startx. Now when I try to launch X, it can find startx perfectly fine, but there are these other four files that it can't seem to locate....

I could just see an entire tree of dependencies, where calling startx will call other files which call other files, etc. Did I really want to make links to all these?

So I removed the link and added /usr/X11R6/bin/ to PATH. This, of course, worked fine.

But my concern with this method is, do I have to add the directory to PATH for everything I want to run, anywhere on the system? I could see this easily getting out of hand. How long can PATH be?

I used to be able to launch X from the command line, several installs ago. I never thought to look at how it was set up.

Any opinions on which method is better? Or is there another option which I haven't thought of?

wmHardRock
12-19-2000, 03:39 PM
There's no limit to the PATH, but I suggest not taking it into personal accounts. Stick with bin dirs.

klamath
12-19-2000, 07:27 PM
$PATH is almost always better.

do I have to add the directory to PATH for everything I want to run, anywhere on the system?

No, just put it in one of the files your shell reads on startup. This differs with the different shells, but try '~/.bashrc' or '~/.profile' -- or, of course, the system-wide versions in /etc

Aside: can't seem to get out of the GUI once in. Crtl-Alt-Backspace sends me to the graphical login prompt. Have to track down why

It's something along the lines of this: your GUI login app (e.g. gdm, xdm, kdm) launches an X session for you when you login. It's configured to restart X (loading itself) when the session it just started has finished. Ctrl-Alt-Backspace kills the X session, your login manager thinks it's time for it to get invovled, and it starts up. Or at least, that's my vague recollection of the process - I haven't used a GUI login manager is a while. To avoid this. just use something like 'Ctrl-Alt-Fn', which n is an integer from 1 to 6 (depending on the config - some distros are setup to allow more virtual consoles).

------------------
- Klamath
Get my GnuPG Key Here (http://klamath.dyndns.org/mykey.asc)
Looking for an open source project to contribute to? Check out the Better Bulletin Board (http://bbb.sourceforge.net)