[plug] Linux auto login

Leon Brooks leon at brooks.fdns.net
Tue Jan 14 10:16:28 WST 2003


On Monday 13 January 2003 12:55 pm, Jason Smuts wrote:
> -<>- I tried adding the line: 'x:3:respawn:/bin/su - myuser "startx"' to
> my /etc/inittab file, but this did not work.  It yields the following
> error message:  " Fatal server error:
>    PAM authentication failed, cannot start X server.
>    Perhaps you do not have console ownership? "

> Fair 'nuff.  Now what?

I happen to use a display manager, so I start X as root using a line like 
this:

    x:5:respawn:/usr/X11R6/bin/X -query ip.of.xdm.server

I also have a client who likes to use his linux gateway servers as spare 
Terminal Server screens for his Windows-based mega-app, and his systems have 
these lines, with the X server given permission to accept connections from 
any local process (which may not be secure enough for you):

    tx:34:respawn:/etc/X11/X
    ts:34:respawn:/bin/su - jrandomuser ./start_rdesktop.sh
    ss:34:respawn:/bin/su - jrandomuser ./start_screensaver.sh

At startup, the ts and ss lines fail a few times until X gets a leg-up, but it 
basically works well. The start_rdesktop script looks like this:

#!/bin/sh
export DISPLAY=localhost:0.0
/usr/X11R6/bin/xsetroot -bitmap from-castle-rock.xbm
/usr/bin/rdesktop --fullscreen --bs x --built-in-license 192.168.23.5

The screensaver script could be more complex, but I've settled for this, for 
now:

#!/bin/sh
xscreensaver

...but as the machines get 3D cards and real processors, I'll throw in a few 
of these:

    http://rss-glx.sourceforge.net/

You might want to try using login -f instead of su, and/or redirect the IO to 
a console device (tty#) or running X through the `open' command (`man open' 
will soon be your friend).

Cheers; Leon



More information about the plug mailing list