LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-24-2010, 07:17 AM   #1
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Rep: Reputation: 36
How to disable X windows?


I have modified /etc/inittab file for changing default runlevel from 5 to 3 .
Now i can boot in terminal mode .However if i issue init 5 i get a X window.
How would i disable loading X? do i need to disable some services?
P.S.
What is Xvfb? How would i disable it?
My Distribution Details.
Code:
# lsb_release -a
LSB Version:    :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: EnterpriseEnterpriseServer
Description:    Enterprise Linux Enterprise Linux Server release 5.2 (Carthage)
Release:        5.2
Codename:       Carthage
# uname -a
Linux OFSMUW-VMGR-51 2.6.18-92.el5PAE #1 SMP Fri May 23 22:26:05 EDT 2008 i686 i686 i386 GNU/Linux
 
Old 11-24-2010, 07:21 AM   #2
jlcasado
LQ Newbie
 
Registered: Oct 2010
Location: Madrid - Spain
Distribution: RHEL
Posts: 26

Rep: Reputation: Disabled
Hi,

On the /etc/inittab file you can find that X is started so you can comment out those lines....

But why you would like to go into runlevel 5 if you don't want the X windows to be started?

Best regards
jose
 
Old 11-24-2010, 07:24 AM   #3
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,527

Rep: Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898Reputation: 898
Quote:
What is Xvfb? How would i disable it?
http://en.wikipedia.org/wiki/Xvfb

Quote:
How to disable X windows?
uninstall X ?


Kind regards
 
Old 11-24-2010, 07:25 AM   #4
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
You could simply comment out the line I have highlighted in /etc/inittab:
Code:
# /etc/init.d/rc takes care of runlevel handling
#
# runlevel 0  is  System halt   (Do not use this for initdefault!)
# runlevel 1  is  Single user mode
# runlevel 2  is  Local multiuser without remote network (e.g. NFS)
# runlevel 3  is  Full multiuser with network
# runlevel 4  is  Not used
# runlevel 5  is  Full multiuser with network and xdm
# runlevel 6  is  System reboot (Do not use this for initdefault!)
#
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
#l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
If your concern is with security, you could uninstall X support using your package system as well, or opt for a minimal installation when installing, not installing the Xorg server in the first place.
 
Old 11-24-2010, 10:27 PM   #5
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by jschiwal View Post
You could simply comment out the line I have highlighted in /etc/inittab:
Code:
# /etc/init.d/rc takes care of runlevel handling
#
# runlevel 0  is  System halt   (Do not use this for initdefault!)
# runlevel 1  is  Single user mode
# runlevel 2  is  Local multiuser without remote network (e.g. NFS)
# runlevel 3  is  Full multiuser with network
# runlevel 4  is  Not used
# runlevel 5  is  Full multiuser with network and xdm
# runlevel 6  is  System reboot (Do not use this for initdefault!)
#
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
#l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
If your concern is with security, you could uninstall X support using your package system as well, or opt for a minimal installation when installing, not installing the Xorg server in the first place.
It would be great help if you explain why have you commented the line?
How would i uninstall X Which package needs to be removed?How would i find which file is to be done?
There was no choice of not installing X while Installing OS.

Last edited by pinga123; 11-24-2010 at 10:35 PM.
 
Old 11-24-2010, 11:02 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
If you want to remove Xwin from the cmd line, you'll need one or more of the 'yum' cmds: http://kbase.redhat.com/faq/docs/DOC-2531
However, the qn remains; why 'init 5' if you don't want Xwin?
init level 3 gives you a full capability server. init 5 is specifically to start the Xwindows.
As for init 4, it's officially undefined/avail to local user to provide a cusstom state.
http://www.linuxtopia.org/online_boo...ices-runlevels
 
Old 11-24-2010, 11:45 PM   #7
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by chrism01 View Post
If you want to remove Xwin from the cmd line, you'll need one or more of the 'yum' cmds: http://kbase.redhat.com/faq/docs/DOC-2531
However, the qn remains; why 'init 5' if you don't want Xwin?
init level 3 gives you a full capability server. init 5 is specifically to start the Xwindows.
As for init 4, it's officially undefined/avail to local user to provide a cusstom state.
http://www.linuxtopia.org/online_boo...ices-runlevels
Did as per you said still not able to achieve as per the requirement .
I have commented following line.
Code:
l5:5:wait:/etc/init.d/rc 5
Reboot the system.
it was booted in runlevel 3.
later i run init 5 and it went to graphical mode.
What is the use of commenting l5:5:wait:/etc/init.d/rc 5 ?
 
Old 11-25-2010, 12:02 AM   #8
JoshyJ
Member
 
Registered: Nov 2003
Location: Sydney , Australia
Distribution: Fedora
Posts: 49

Rep: Reputation: 1
As most people have said. There is no point in changing to runlevel 5 as that is purely for X Windows.

Is there something that you placed in runlevel 5? or specific reason for wanting runlevel 5?
 
Old 11-25-2010, 12:03 AM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Exaclty what did you do? I pointed out that you need to apply the correct yum cmds from the cmd line (as root) to remove the deskop/Xwin Sw.
You'd start with

yum grouplist

then use the

yum remove <relevant groupname>

to remove the desktop/Xwin stuff.
I'm not on Linux right now, so you'll have to get the correct name yourself.

Last edited by chrism01; 11-29-2010 at 11:24 PM.
 
Old 11-25-2010, 12:15 AM   #10
pinga123
Member
 
Registered: Sep 2009
Posts: 684
Blog Entries: 2

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by jschiwal View Post
You could simply comment out the line I have highlighted in /etc/inittab:
Code:
# /etc/init.d/rc takes care of runlevel handling
#
# runlevel 0  is  System halt   (Do not use this for initdefault!)
# runlevel 1  is  Single user mode
# runlevel 2  is  Local multiuser without remote network (e.g. NFS)
# runlevel 3  is  Full multiuser with network
# runlevel 4  is  Not used
# runlevel 5  is  Full multiuser with network and xdm
# runlevel 6  is  System reboot (Do not use this for initdefault!)
#
l0:0:wait:/etc/init.d/rc 0
l1:1:wait:/etc/init.d/rc 1
l2:2:wait:/etc/init.d/rc 2
l3:3:wait:/etc/init.d/rc 3
#l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
l6:6:wait:/etc/init.d/rc 6
If your concern is with security, you could uninstall X support using your package system as well, or opt for a minimal installation when installing, not installing the Xorg server in the first place.
Thanks for your replies and most of my doubts are clear but I m still not clear why there is need to comment out the line in code where the same can be achieved making default runlevel 3.
I just want to know the diference between making default runlevel 3 and commenting the highlighted line as per jschiwal's post.



There are no services that are there in runlevel 5 I just want to avoid going into runlevel 5.
For example i should be getting error or nothing should happen when i type init 5.Is this possible?

Last edited by pinga123; 11-25-2010 at 12:17 AM.
 
Old 11-29-2010, 10:45 AM   #11
jlcasado
LQ Newbie
 
Registered: Oct 2010
Location: Madrid - Spain
Distribution: RHEL
Posts: 26

Rep: Reputation: Disabled
Hi,

Commenting lines:
Code:
l4:4:wait:/etc/init.d/rc 4
l5:5:wait:/etc/init.d/rc 5
will avoid that when you run "/sbin/init 5" or "/sbin/init 4" no scripts under /etc/rc.d/rc5.d/ or /etc/rc.d/rc4.d/ will be run (a nice doc to read is here).

Regardign your last question, you are right, selecting the runlevel for inittab is enough for starting in the right runlevel and nothing else is needed.

Cheers
jose
 
  


Reply


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
Remote disable windows firewall ahmed_as8 Linux - Networking 1 03-05-2009 07:02 AM
windows seems to disable grub theory_prof Linux - General 11 08-22-2008 08:04 PM
How2 disable access to windows shares. holeg Linux - Newbie 2 07-13-2006 02:23 AM
How to disable X windows inaki Linux - Software 12 06-24-2006 08:57 PM
Disable Auto-mounting of devices in .... WINDOWS? opioid General 4 04-20-2006 02:35 PM


All times are GMT -5. The time now is 10:11 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration