LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-26-2009, 07:29 AM   #1
deostroll
Member
 
Registered: Aug 2007
Location: Bangalore
Distribution: fedora
Posts: 113

Rep: Reputation: 15
Boot to a login shell instead of gui


We have a centos machine which serves as a web server. We also have a mysql server running on it. Currently we log-in via a gui prompt into a gui session. We are looking at changing this aspect; we want to login via the shell instead of gui. We'd need to keep all the current services on that machine running however. What should we do?

Even once this is done I'd need to know how to start a gui session from the shell itself.
 
Old 08-26-2009, 07:39 AM   #2
TBC Cosmo
Member
 
Registered: Feb 2004
Location: NY
Distribution: Fedora 10, CentOS 5.4, Debian 5 Sparc64
Posts: 356

Rep: Reputation: 43
In the file /etc/inittab, change:
Code:
id:5:initdefault:
to

Code:
id:3:initdefault:
When the server is booted, it will be in runlevel 3. That means multiuser with network but no GUI. When in runlevel 3, you can type init 5, as root, to get to runlevel 5, which is multiuser with network and GUI. To go back, you type init 3.
 
Old 08-26-2009, 07:44 AM   #3
deostroll
Member
 
Registered: Aug 2007
Location: Bangalore
Distribution: fedora
Posts: 113

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by TBC Cosmo View Post
To go back, you type init 3.
You mean in the shell once we login successfully?

Would this have any effect on services already running on the computer? Particularly with reference to mysql server?
 
Old 08-26-2009, 07:53 AM   #4
kdelover
Member
 
Registered: Aug 2009
Posts: 311

Rep: Reputation: 36
yeah type init 5 to go back to GUI or type telinit 5,to reboot type telinit 6.

Regarding second question it depends if the mysql server is allowed to start in runlevel 5. do this chkconfig --list and grep for mysql.If its off in runlevel 5 then enable it throught

chkconfig --level=5 mysqld on
 
Old 08-26-2009, 07:59 AM   #5
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by deostroll View Post
You mean in the shell once we login successfully?

Would this have any effect on services already running on the computer? Particularly with reference to mysql server?
check what services run in level 5 and compare that to level 3.
normally they are the same.

Code:
chkconfig --list | awk '/5:on|3:on/ {print $1, $5, $7}'
 
Old 08-26-2009, 08:31 AM   #6
deostroll
Member
 
Registered: Aug 2007
Location: Bangalore
Distribution: fedora
Posts: 113

Original Poster
Rep: Reputation: 15
@centosboy: I've tried the following:
Code:
 chkconfig --list | awk '/5:on|3:on/ {print $1, $5, $7}' | grep 'mysql'
and it returned:
Code:
mysqld 3:on 5:on
which means the service should be turned on right?
 
Old 08-26-2009, 08:54 AM   #7
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by deostroll View Post
@centosboy: I've tried the following:
Code:
 chkconfig --list | awk '/5:on|3:on/ {print $1, $5, $7}' | grep 'mysql'
and it returned:
Code:
mysqld 3:on 5:on
which means the service should be turned on right?
yes, this means the service is on in level 3 and 5, so there is no need to worry if switching between these runlevels. mysql is set to always start
 
Old 08-26-2009, 10:36 AM   #8
deostroll
Member
 
Registered: Aug 2007
Location: Bangalore
Distribution: fedora
Posts: 113

Original Poster
Rep: Reputation: 15
It seems you can only do an init 5 from the root prompt if you want to log-in to the gui session from the shell. Is this process similar to a normal restart?

Now after the default session to set to a shell, we do a normal login and then interchange to the gui session. There, on logging out it by default displays the login to a gui session. How to change this? I mean from a gui session if I did a logout I want to see my shell login prompt...
 
Old 08-26-2009, 11:05 AM   #9
elprawn
Member
 
Registered: Feb 2005
Distribution: Gentoo 2008
Posts: 138

Rep: Reputation: 15
If you're in a GUI session and want to switch to shell prompt, just press ctrl+alt+F1
 
  


Reply

Tags
centos, login, shell


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need to write a shell script which will check the GUI login and retuen the status cod bhsk_08 Linux - General 2 10-14-2008 01:08 PM
Fedora 6 CHAR login to GUI login kallimathp1 Linux - Newbie 4 04-24-2007 04:03 AM
Boot up GUI and Account login screen? Vor Kragresh Slackware 16 04-18-2007 06:57 AM
bypassing the GUI login and turn in Shell mode micro_xii Linux - Newbie 3 12-23-2006 03:18 AM
login screen...GUI not boot for a user linux_blnk182 SUSE / openSUSE 2 01-04-2005 12:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:11 AM.

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