Taking GDM out the equation (help with init)
Hi. I'll explain what I'm trying to do, and see if that makes any sense. Making I *am* thinking about it the wrong way. But please take the time to read.
I'm the only user of my system (Fedora core 5), and I never change desktop/locale, I only use Gnome, and gdm always logged me in automatically. so I thought 'why do I need it' :) gdm is a waste of time for me. So to prevent gdm starting at boot I commented out the relevant line in inittab.
#x:5:once:/etc/X11/prefdm -nodaemon
Right. So on boot I get 6 virtual terminals (mingetty). My user 'matt' might as well automatically log in to tty1, so in init I add the revevant line, which works fantastically as expected.
x:5:respawn:/sbin/mingetty --autologin matt tty1
Now my question is this - what's the best way to startx automatically as my user from init? One option I found was to add a line to my bash_profile
- if ( x is not running AND current terminal is tty1) then startx
That worked, but I think it's ugly. Running that condition everytime I open a shell, and seccondly, I lose tty1, my favourite tty. I don't care about that screen filling with error messages, so is there a way I can launch startx as a new process, so I can keep using tty1, and the messages dissapear somewhere?
[UPDATE] I tried startx & but this did the thing where x starts, I get the cursor and blue screen, but doesn't log me into Gnome. [/UPDATE]
But still, do you reckon people if the bash profile way is best? It still seems ugily to me. Earlier I tried this in init.
x:5:once:/usr/bin/sudo -u matt startx
Is that ugly itself? Using sudo so root starts x as matt? It didn't work - I got an xauthority time out for a minute or so, then again, X did start eventually, but didn't log me into Gnome and just left me with the screen and cursor.
If anyone's done anything like this before, I'd just be interested. Thoughts welcome y'all.
Last edited by mattme; 05-30-2006 at 08:20 AM.
Reason: remove smilies!
|