[RndTbl] TTY1 and Starting X Windows

Montana Quiring montanaq at gmail.com
Wed Apr 19 08:59:00 CDT 2006

> If you read this thread to the end, you'll see that the X server is
> launched
> from within root's ~/.bash_profile, which would explain why you see this
> problem...

Hee hee. Ya, that was me that posted that. *wink*

> This strikes me as a roundabout way of doing things, and also (as you've
> discovered) not very bullet-proof.  I'd recommend you change the
> .bash_profile to not start the X server from there, but rather start it
> in its own line in /etc/inittab, such as this...
> x:5:respawn:/usr/X11R6/bin/startx
> Also note that commands started in inittab aren't automatically bound to a
> tty (such as a virtual console), so you might need to explicitly do so
> using
> redirects (as they did for the bash -login).  That's not necessary when
> you
> invoke getty, since you specify a tty as a command line argument to it,
> and
> it's job is to set up a process group bound to the tty.  This likely won't
> matter in the case of X, but if you want to debug or check output from the
> X server or clients, then you should redirect it somewhere (a log file if
> not a virtual console).

Thanks for all the info Gilbert. You put me on the right path.
I found that if I put:
startx; kill -9 $$
in the ~/.bash_profile
It goes to a login prompt instead of a BASH prompt after the user presses
Control+C, so that's a temp workaround. I would like to get your
suggestion working in /etc/inittab
I put the line:
in my /etc/inittab after the other getty TTY's
...but like you said it looks like I need to redirect it to a tty, as X
does not start up.
I've been googling trying to figure out how to do that, but no dice yet.
If you can give me a hint I'd appreciate it.

This is what is in my /etc/inttab:
....the rc scripts setup and stuff...
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
x:5:respawn:/usr/X11R6/bin/startx > tty1

Thanks for your patience. I haven't worked with inittab much in the past,
so this has been a real learning experience for me.

More information about the Roundtable mailing list