LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-30-2006, 06:52 AM   #1
mattme
LQ Newbie
 
Registered: Apr 2006
Posts: 3

Rep: Reputation: 0
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!
 
Old 05-31-2006, 12:39 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Ubuntu 12.04, Antix19.3
Posts: 3,794

Rep: Reputation: 282Reputation: 282Reputation: 282
The usual way to 'prevent' X from starting is to change the runlevel in inittab.
Code:
id:3:initdefault:
This line comes from Slackware's inittab and starts the system without X (runlevel 4 would be start with GUI).
I think that in FC, the runlevels are 4 (without GUI) and 5 (with GUI).

Find the above line in your inittab and modify it according to instructions in the file.

Next you can start X using startx & as you already tried. It still gives you a screen full of messages, but your terminal is available again.

Messages can be suppressed by redirecting output.
Code:
startx >startx.log 2>&1 &
PS 1
You have to undo all your changes first and start from scratch.
PS 2
I don't know how this behaves with autologon.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Algebra Equation Software a_c_g_t Linux - Newbie 2 04-27-2006 08:46 AM
Transparency Equation leonidg Programming 3 02-08-2005 02:38 AM
Init 4: Logging out of KDE causes black screen, freeze with GDM, KDM and XDM DaneM Slackware 14 02-03-2005 07:38 PM
an equation in c language liquid sky Programming 5 03-22-2004 02:25 PM
How to create equation in Abiword ? futurist General 9 04-07-2002 12:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration