Help - Search - Members - Calendar
Full Version: Its Been A Wile
Linuxhelp > Support > Technical Support
Jim
Its been a while since I have asked a question in here, but here is my problem.

I recently decided to set up my gentoo system for graphical log in, I had just been using a text log in. Anyway, got it up and running, works well, except, now when I log in and start a terminal I get a wierd bash, not my normal one. I guess its not really the bash thats wierd, just the format. So I have to manually load my profile, how do I get it to do it automatically.

CODE
bash-2.05b$ source /etc/profile
jim@argento jim $


Also, I can't seem to run any programs in graphical mode as root. I get a bunch of errors. I don't know what the problem is.
CODE
jim@argento jim $ su
Password:
root@argento jim # emacs /etc/rc.conf
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

emacs: Cannot connect to X server :0.0.
Check the DISPLAY environment variable or use `-d'.
Also use the `xhost' program to verify that it is set to permit
connections from your machine.

root@argento jim # source /etc/profile
argento jim # emacs /etc/rc.conf
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

emacs: Cannot connect to X server :0.0.
Check the DISPLAY environment variable or use `-d'.
Also use the `xhost' program to verify that it is set to permit
connections from your machine.

argento jim #
hughesjr
The easiest thing to do is just put:

source /etc/profile

In your home/username/.bash_profile
Jim
Where?

CODE
# /etc/skel/.bash_profile:
# $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/skel/.bash_profile,v 1.10 2002/11/18 19:39:22 azarah Exp $

#This file is sourced by bash when you log in interactively.
[ -f ~/.bashrc ] && . ~/.bashrc


And did you see the second half or did I add that after you posted?
hughesjr
You can put it at the bottom of the file ... after the:

[ -f ~/.bashrc ] && . ~/.bashrc

For your x issue ... do the command (as the user ... before you switch to root):

xhost +

Also ... if you want to run graphical items as root from another users shell, use the command:

su - root

instead of

su

su by itself doesn't change the environment variables, so you are running as root with jim's environment variables. You should limit su to times when you need to do things quickly like change file permissions and then exit back to the original user.

su - root actually logins in as root, and changes the environment variables to those for root ... you will be in root's home directory. This is the way you should normally switch to the root user...
Jim
Both problems are still there. I can't runt graphically as root, and I get a funky looking bash. What else might be causing the ploblem?
hughesjr
it could be that your .bash_profile isn't being run at all ... so you aren't getting any environment variables.

I don't know what might cause that though ... are you booting into the graphical mode?

I don't have my Gentoo machine any more (well, I have the machine, but it is now CentOS-4), so this is from memory....but what happens if you remove your display manager from the default runlevel with a :

rc-update del gdm default

(and the same for xdm and kdm)

You should reboot into Character based mode...when you login are your terminals as they should be now?

can you startx as a user and as root?
Jim
ya I just did all that, everything works fine if I boot up in run level 3, its when I got to 5 that causes the problems. I don't know. I will screw with it more later tonight.
Hemant
I think...for a non-login terminal .bashrc is loaded.Not .bash_profile.But what most of us do is..in the .bashrc we read the content of .bash_prfile.

And yes,hughesjr is correct..you can't just do a su and run graphical programs.I am not able to do that in FC-2.
Jim
I have been doing su and running graphically in my terminals for as long as I can remember. I can go do it right now, I just can't do it when I switch to graphical log in. The problem is steaming from xdm and/or kdm I just don't know how or why.
hughesjr
I'm not sure there is a runlevel 5 in Gentoo by default ... just 1 through 3 i think. (but I'm not positive ... i don't have an install to look at right now).
Jim
Well what ever (six is reboot I know that) the point is, I only have these problems when I boot straight into graphical mode, when I boot to text mode then startx manually it doesn't give me these problems. I don't really want to waste a ton of time on this, I will just keep using text mode, but if I could figure it out that would be good.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.