How to disable X windows?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to disable X windows?
# 1  
Old 11-24-2010
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

# 2  
Old 11-24-2010
if the runlevel is 3 where is the problem? only root can change runlevel...

Stopping X services can lead to issues since some software rely on (oracleInstaller etc...). the same for Xvfb (if configured that is because I believe it does not run on its own...).
So either you stick to your int 3 default plan, or you remove the links in runlevel 5
# 3  
Old 11-24-2010
How would i remove the links in runlevel 5?
# 4  
Old 11-25-2010
Do you have in /etc a rc5.d directory? or a init.d directory? or rc.d/init.d directory? if so what is in it? ( I have no RH or centos linux to check...)

Addendum:
look at this URL:
http://stackoverflow.com/questions/1...-redhat-centos

Last edited by vbe; 11-25-2010 at 01:26 PM.. Reason: addendum
# 5  
Old 11-25-2010
Just unlink the soft link, which you would be having for the X init, inside your default runlevel of /etc/init.d/rc5.d

This works pretty well but is considered a hard way of doing so.

Otherwise sophisticatedly, you may also wish to consider chkconfig utility. This is just a command line utility to add/delete an init script at an specified runlevel. Look google for its command usage. It’s a pretty simple one to use too.
This User Gave Thanks to Praveen_218 For This Post:
# 6  
Old 11-25-2010
Quote:
Originally Posted by Praveen_218
Just unlink the soft link, which you would be having for the X init, inside your default runlevel of /etc/init.d/rc5.d

This works pretty well but is considered a hard way of doing so.

Otherwise sophisticatedly, you may also wish to consider chkconfig utility. This is just a command line utility to add/delete an init script at an specified runlevel. Look google for its command usage. It's a pretty simple one to use too.
Since there are so many links i m confused which one to unlink.
Can you please guide me?
Code:
# cd /etc/rc.d/rc5.d/
[rc5.d]# ls -ltr
total 316
lrwxrwxrwx 1 root root 11 May 14  2010 S99local -> ../rc.local
lrwxrwxrwx 1 root root 16 Jul 29 20:06 S99smartd -> ../init.d/smartd
lrwxrwxrwx 1 root root 19 Jul 29 20:06 S99firstboot -> ../init.d/firstboot
lrwxrwxrwx 1 root root 19 Jul 29 20:06 S98haldaemon -> ../init.d/haldaemon
lrwxrwxrwx 1 root root 22 Jul 29 20:06 S98avahi-daemon -> ../init.d/avahi-daemon
lrwxrwxrwx 1 root root 22 Jul 29 20:06 S97yum-updatesd -> ../init.d/yum-updatesd
lrwxrwxrwx 1 root root 15 Jul 29 20:06 S97rhnsd -> ../init.d/rhnsd
lrwxrwxrwx 1 root root 25 Jul 29 20:06 S96readahead_later -> ../init.d/readahead
_later
lrwxrwxrwx 1 root root 15 Jul 29 20:06 S95jexec -> ../init.d/jexec
lrwxrwxrwx 1 root root 13 Jul 29 20:06 S95atd -> ../init.d/atd
lrwxrwxrwx 1 root root 17 Jul 29 20:06 S95anacron -> ../init.d/anacron
lrwxrwxrwx 1 root root 16 Jul 29 20:06 S91tomcat -> ../init.d/tomcat
lrwxrwxrwx 1 root root 13 Jul 29 20:06 S91smb -> ../init.d/smb
lrwxrwxrwx 1 root root 13 Jul 29 20:06 S90xfs -> ../init.d/xfs
lrwxrwxrwx 1 root root 15 Jul 29 20:06 S90crond -> ../init.d/crond
lrwxrwxrwx 1 root root 13 Jul 29 20:06 S85gpm -> ../init.d/gpm
lrwxrwxrwx 1 root root 18 Jul 29 20:06 S80sendmail -> ../init.d/sendmail
lrwxrwxrwx 1 root root 19 Jul 29 20:06 S80oracle-xe -> ../init.d/oracle-xe
lrwxrwxrwx 1 root root 16 Jul 29 20:06 S56xinetd -> ../init.d/xinetd
lrwxrwxrwx 1 root root 14 Jul 29 20:06 S56cups -> ../init.d/cups
lrwxrwxrwx 1 root root 14 Jul 29 20:06 S55sshd -> ../init.d/sshd
lrwxrwxrwx 1 root root 15 Jul 29 20:06 S50hplip -> ../init.d/hplip
lrwxrwxrwx 1 root root 15 Jul 29 20:06 S44acpid -> ../init.d/acpid
lrwxrwxrwx 1 root root 16 Jul 29 20:06 S28autofs -> ../init.d/autofs
lrwxrwxrwx 1 root root 14 Jul 29 20:06 S26hidd -> ../init.d/hidd
lrwxrwxrwx 1 root root 14 Jul 29 20:06 S26apmd -> ../init.d/apmd
lrwxrwxrwx 1 root root 15 Jul 29 20:06 S25pcscd -> ../init.d/pcscd
lrwxrwxrwx 1 root root 15 Jul 29 20:06 S25netfs -> ../init.d/netfs
lrwxrwxrwx 1 root root 19 Jul 29 20:06 S25bluetooth -> ../init.d/bluetooth
lrwxrwxrwx 1 root root 20 Jul 29 20:06 S22messagebus -> ../init.d/messagebus
lrwxrwxrwx 1 root root 17 Jul 29 20:06 S19rpcgssd -> ../init.d/rpcgssd
lrwxrwxrwx 1 root root 19 Jul 29 20:06 S18rpcidmapd -> ../init.d/rpcidmapd
lrwxrwxrwx 1 root root 19 Jul 29 20:06 S15mdmonitor -> ../init.d/mdmonitor
lrwxrwxrwx 1 root root 17 Jul 29 20:06 S14nfslock -> ../init.d/nfslock
lrwxrwxrwx 1 root root 24 Jul 29 20:06 S13setroubleshoot -> ../init.d/setroubles
hoot
lrwxrwxrwx 1 root root 17 Jul 29 20:06 S13portmap -> ../init.d/portmap
lrwxrwxrwx 1 root root 18 Jul 29 20:06 S13mcstrans -> ../init.d/mcstrans
lrwxrwxrwx 1 root root 20 Jul 29 20:06 S13irqbalance -> ../init.d/irqbalance
lrwxrwxrwx 1 root root 16 Jul 29 20:06 S12syslog -> ../init.d/syslog
lrwxrwxrwx 1 root root 21 Jul 29 20:06 S12restorecond -> ../init.d/restorecond
lrwxrwxrwx 1 root root 16 Jul 29 20:06 S11auditd -> ../init.d/auditd
lrwxrwxrwx 1 root root 17 Jul 29 20:06 S10network -> ../init.d/network
lrwxrwxrwx 1 root root 14 Jul 29 20:06 S09isdn -> ../init.d/isdn
lrwxrwxrwx 1 root root 18 Jul 29 20:06 S08iptables -> ../init.d/iptables
lrwxrwxrwx 1 root root 19 Jul 29 20:06 S08ip6tables -> ../init.d/ip6tables
lrwxrwxrwx 1 root root 18 Jul 29 20:06 S06cpuspeed -> ../init.d/cpuspeed
lrwxrwxrwx 1 root root 15 Jul 29 20:06 S05kudzu -> ../init.d/kudzu
lrwxrwxrwx 1 root root 25 Jul 29 20:06 S04readahead_early -> ../init.d/readahead
_early
lrwxrwxrwx 1 root root 22 Jul 29 20:06 S02lvm2-monitor -> ../init.d/lvm2-monitor
lrwxrwxrwx 1 root root 23 Jul 29 20:06 S00microcode_ctl -> ../init.d/microcode_c
tl
lrwxrwxrwx 1 root root 14 Jul 29 20:06 K91capi -> ../init.d/capi
lrwxrwxrwx 1 root root 15 Jul 29 20:06 K89rdisc -> ../init.d/rdisc
lrwxrwxrwx 1 root root 14 Jul 29 20:06 K89pand -> ../init.d/pand
lrwxrwxrwx 1 root root 18 Jul 29 20:06 K89netplugd -> ../init.d/netplugd
lrwxrwxrwx 1 root root 14 Jul 29 20:06 K89dund -> ../init.d/dund
lrwxrwxrwx 1 root root 24 Jul 29 20:06 K88wpa_supplicant -> ../init.d/wpa_suppli
cant
lrwxrwxrwx 1 root root 20 Jul 29 20:06 K87multipathd -> ../init.d/multipathd
lrwxrwxrwx 1 root root 14 Jul 29 20:06 K87ipmi -> ../init.d/ipmi
lrwxrwxrwx 1 root root 15 Jul 29 20:06 K85mdmpd -> ../init.d/mdmpd
lrwxrwxrwx 1 root root 15 Jul 29 20:06 K80kdump -> ../init.d/kdump
lrwxrwxrwx 1 root root 14 Jul 29 20:06 K74ntpd -> ../init.d/ntpd
lrwxrwxrwx 1 root root 14 Jul 29 20:06 K74nscd -> ../init.d/nscd
lrwxrwxrwx 1 root root 20 Jul 29 20:06 K69rpcsvcgssd -> ../init.d/rpcsvcgssd
lrwxrwxrwx 1 root root 20 Jul 29 20:06 K50netconsole -> ../init.d/netconsole
lrwxrwxrwx 1 root root 19 Jul 29 20:06 K35vncserver -> ../init.d/vncserver
lrwxrwxrwx 1 root root 14 Jul 29 20:06 K24irda -> ../init.d/irda
lrwxrwxrwx 1 root root 13 Jul 29 20:06 K20nfs -> ../init.d/nfs
lrwxrwxrwx 1 root root 16 Jul 29 20:06 K10psacct -> ../init.d/psacct
lrwxrwxrwx 1 root root 17 Jul 29 20:06 K05wdaemon -> ../init.d/wdaemon
lrwxrwxrwx 1 root root 19 Jul 29 20:06 K05saslauthd -> ../init.d/saslauthd
lrwxrwxrwx 1 root root 16 Jul 29 20:06 K05conman -> ../init.d/conman
lrwxrwxrwx 1 root root 34 Jul 29 20:06 K02NetworkManagerDispatcher -> ../init.d/
NetworkManagerDispatcher
lrwxrwxrwx 1 root root 24 Jul 29 20:06 K02NetworkManager -> ../init.d/NetworkMan
ager
lrwxrwxrwx 1 root root 16 Jul 29 20:06 K02dhcdbd -> ../init.d/dhcdbd
lrwxrwxrwx 1 root root 24 Jul 29 20:06 K02avahi-dnsconfd -> ../init.d/avahi-dnsc
onfd
lrwxrwxrwx 1 root root 18 Nov  2 17:24 S99webmin -> /etc/init.d/webmin
lrwxrwxrwx 1 root root 14 Nov 17 21:27 K73ldap -> ../init.d/ldap
lrwxrwxrwx 1 root root 16 Nov 25 22:15 K73ypbind -> ../init.d/ypbind
lrwxrwxrwx 1 root root 17 Nov 25 22:15 K35winbind -> ../init.d/winbind

# 7  
Old 11-26-2010
Disabling X.

As a Security practice I wanted to disable X from loading.
So i modified following line from /etc/inittab.
id:3:initdefault:
I was then able to start my machine in terminal mode(runlevel 3).

I wasn't satisfied at this stage as i was able to get the graphical console by merely typing
Code:
#init 5

So i search and find out that the reason for loading the graphical user interface was a script resided in
Code:
/etc/X11/prefdm

So i renamed it thinking OS will fail in finding it when invoked by inittab file .
To my surprise i was able to get the terminal back even if i hit
#init 5
but then i realize i keep on getting following error lines.
Code:
INIT: cannot execute "/etc/X11/prefdm"
INIT: cannot execute "/etc/X11/prefdm"
INIT: Id "x" respawning too fast: disabled for 5 minutes
respawn

I found out the reason behind this was a line in /etc/inittab
Code:
x:5:respawn:/etc/X11/prefdm -nodaemon

(respawn The process will be restarted whenever it terminates)
Since the file prefdm was renamed and respawned the OS was keep on trying to execute it considering it is terminated.

Now i have made the above line commented and removed execute bit of the file .
System is now behaving as i wish it would.

Will it make any difference?
I m not using any application that explicitly use graphical user interface and i can work in runlevel 3.

Last edited by pinga123; 11-26-2010 at 01:54 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Disable X windows in Enterprise?

I work for a small company and we are heavily invested in linux. I would like to find out if it is advantageous to disable/remove X11 or X windows so no GUI login is available. Any good compelling reasons? (2 Replies)
Discussion started by: capri_guy84
2 Replies

2. Red Hat

SSL/TLS renegotiation DoS -how to disable? Is it advisable to disable?

Hi all Expertise, I have following issue to solve, SSL / TLS Renegotiation DoS (low) 222.225.12.13 Ease of Exploitation Moderate Port 443/tcp Family Miscellaneous Following is the problem description:------------------ Description The remote service encrypts traffic using TLS / SSL and... (2 Replies)
Discussion started by: manalisharmabe
2 Replies

3. Shell Programming and Scripting

How to disable Enable/Disable Tab Key

Hi All, I have bash script, so what is sintax script in bash for Enable and Disable Tab Key. Thanks for your help.:( Thanks, Rico (1 Reply)
Discussion started by: carnegiex
1 Replies
Login or Register to Ask a Question