Ok, here's the idea.  If I get to complex, let me know.

When you say 'startx' at the cmdline, a bash script sets up a few things
and then runs a program called xinit.  That runs a script called
/usr/X11R6/lib/X11/xinit/xinitrc, unless the script ~/.xinitrc exist in
which case it is run instead.  That script is responsible for a few
things.  Running xmodmap, setting up resources, etc, but most importantly
starting a window manager and some programs.  When that script exits, the
session is over.  This means that all of the programs that you start have
to be started in the backgroud (ie with an '&' after the command) except
the last program.  This program is run in the foreground, and naturally,
when this last program exits, so does the script and then the entire
session.  Some people choose to start the wm last, I prefer to have an
xterm at the bottom of the screen.  When I close the xterm the session is
over.

XDM works the same way, except that the scripts are different.  For xdm,
it's /etc/X11/xdm/Xsession, or ~/.xsession.  In many cases, you can create
a .xsession file in you home directory and then make .xinitrc an symlink
to it.

Now, if you can log in as root, and not as a mortal user, then there are
some permission problem.  First, make sure that /usr/bin/X11R6/bin is in
your path. (add export PATH=$PATH:/usr/X11R6/bin to your ~/.bashrc file).
If you installed X11 from the redhat rpm, then the last program run from
the xinitrc file is an xterm titled login.  Xterm has to be run setuid
root (chmod 4755 /usr/X11R6/bin/xterm) so that it can change the
permissions on the /dev/ptty's that it uses.  Be sure to change the
permissions on nxterm and rxvt also.

Let me know if you need more explaining.

-CJO-

C.J. Oster (Linux Guru)
P.O. Box 132
Ponca City, OK
74602-0132
----------------------------------------------------------------
export-a-crypto-sig  RSA in 3 lines of perl.
WARNING, THE FOLLOWING 3 LINES ARE CLASSIFIED AS AN ITAR
CONTROLED MUNITIONS.
#!/usr/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
$/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)


On Fri, 15 May 1998, Joseph Martin wrote:

> I installed XFree86 yesterday and set it up. I can run X through the
> "startx" command as root and everything works great. HOWEVER, when I
> attempt to run X as a normal user it doesn't work. The X server starts,
> but the Window manager (fvwm) doesn't start. Because the window manager
> doesn't start the X server quickly shuts down.
> 
> I just changed init to run level 4 (X) and was able to login as myself and
> run programs with no problem. Therefore the trouble seems to be starting X
> from the command line without changing runlevels. If anyone has any clue
> why the window manager will start as root, but not as a regular user
> please let me know.
> 
> Thanks,
>  
> Joseph Martin
> [EMAIL PROTECTED]
> Linux newbie/sysadmin ( dangerous combo! ;-> )
> 
> 

Reply via email to