Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 22 Feb 2002 16:44:05 -0500
From:      Sumanth Peddamatham <me@bunny.dislocatedbrain.com>
To:        Aniruddha Bohra <bohra@cs.rutgers.edu>
Cc:        freebsd-newbies@freebsd.org, freebsd-questions@freebsd.org
Subject:   Re: Starting X for non root users
Message-ID:  <20020222164405.A5970@bunny.dislocatedbrain.com>
In-Reply-To: <Pine.GSO.4.21.0202080233140.5732-100000@monday.rutgers.edu>; from bohra@cs.rutgers.edu on Fri, Feb 08, 2002 at 02:37:26 -0500
References:  <Pine.GSO.4.21.0202080233140.5732-100000@monday.rutgers.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2002.02.08 02:37 Aniruddha Bohra wrote:
> 
> Hello
> 	I have been trying to get X to work for non root users but
> have
> failed on FreeBSD 4.4.
> 
> 	In any case Xwrapper does not work even for root, but startx
> works(so
> there is nothing wrong with the X configuration).
> 
> 	Xwrapper just starts a gray screen and sits there.
> 
> 	xdm/kdm both show the initial screen, take login and passwd
> 		if login is incorrect, they say login failed
> however, if correct login is provided, the server restarts.
> 
> Any ideas about how to do it?
> 
> Thanks
> Aniruddha

hi aniruddha,

ok, it is my understanding that you can not run X as a non root user.  
i read somewhere that it's something they are going to fix in a later 
rev.  i've spent many a sleepless night trying to figure that one out 
and the closest i've gotten was a mad-crazy sudo hack, but then again, 
X was still running as root.  anyways, my current setup uses XDM which 
atleast sets my login environment as non-root.  i think the problem you 
are having with xdm/kdm is that you don't have the proper lines in your 
~/.xsession file.  i run Gnome, and here's my .xsession file:

<---snip--->
xmodmap -e "pointer = 1 2 3 6 7 4 5"
imwheel -p -b '76'
gnome-session
<---/snip--->

(you can ignore the modmap and imwheel stuff.  they are there to get my 
scroller and side buttons on my intellimouse explorer to work.)

the command to start KDE is 'startkde'.  all you have to do is create a 
file ~/.xsession with the line 'startkde' in it and you should be ready 
to go.  the reason the X server just reboots after login is because it 
runs the local login scripts, akin to your 'startup folder' on winxx, 
if there isn't anything in them, it assumes you're done using X and it 
politely restarts for the next user to login.  (that's why the server 
'restarts' when you quit KDE or Gnome.  it's not any magic on KDE or 
Gnome's part, they are simply local programs and when you 'logout', 
they just save the current session and exit.)

so, the bare minimum that you need in your ~/.xsession file is a 
windowmanager so that you have a running process to let X know you're 
still using it.  it may seem a little confusing because when you start 
KDE or Gnome or 'X' from the root command prompt by typing in 
'startx',  what you are doing is running a start-up script (in fact, 
crack it open and take a look, it's an interesting read) that looks for 
your custom initializations and cleverly starts X by using 'xinit'.  
however, it \doesn't\ look at your ~/.xsession file, it instead looks 
at your ~/.xinitrc file.  most desktop environments (KDE/Gnome/Blah) 
set this file up for you and, if i understand correctly, it's format is 
identical to your .xsession file that xdm calls on startup.  take a 
look and see if you have a .xinitrc file and see what's inside.  if it 
looks safe, just cp it to .xsession and try logging in using xdm.

if you still have problems, let me know.

sumanth p.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-newbies" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020222164405.A5970>