Recently I was taking class for Linux sys admin course. Some one asked me "How do changing run levels affect us or our users?" I replied with following answer:
Well if you are moving to higher run levels, you may make additional services available to users, while moving to a lower run level will causes to services (daemons) to become unavailable. On production server run level 3 is the normally used and rarely changed. However some administrative tasks require the administrator to move system to run level 1 i.e single user mode.
Use the init command to change rune levels:
# init 1
- Runlevel 0 is halt
- Runlevel 1 is single-user
- Runlevels 2-5 are multi-user (some distro uses RUN level 5 to start X [KDE/Gnome])
- Runlevel 6 is for rebooting system
Typing init 3 will move system to run level 3:
# init 3
On most Linux server system default run level is 3 and on most Linux Desktop system default run level is 5. The default run level is defined by the initdefault line at the top of /etc/inittab. So if you wanna change default run level open file /etc/inittab and edit entry initdefault:
# vi /etc/inittab
Set initdefault to 5, so that you can boot to X next time when Linux comes up:
id:5:initdefault:
Save file and reboot to see changes.
getty is the program which opens a tty port, prompts for a login name and password (via /bin/login command). Your console displays a login/password prompt at run levels 1 through 6. You can use ALT+F1...ALT+F6 keys to switch console (use CTRL+ALT+F1..F6 under X windows).
However my experience so far is that students get confused with ssh and KDE/Gnome Desktop login.
SSH logins are handled by sshd server which starts at run level 2/3. KDE/Genome Desktop login are handled by GDM/XDM/KDM display manager which starts at run level 5 (however Debian Linux and some other distro can start them from run level 2 via special rc.d script located in /etc/init.d/gdm)
Related articles:
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- 10 Greatest Open Source Software Of 2009
- My 10 UNIX Command Line Mistakes
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
- Email this to a friend
- Download PDF version
- Printable version
- Comment RSS feed
- Last Updated: Sep/3/2008


{ 5 comments… read them below or add one }
you have some good content! i’m reading this blog since last 4+ months; althoug it is not updated daily like other blog/sites still it makes a good read as it is based upon Linux/UNIX sys admins hard core experince
considering only 1 or 2 perople contributes to this blog it is a good read and you have Good number of hits as well. Just wanna say good job man & keep it up
my questions is very simple how do i find out current runlevel as well as last runlevel? since you take linux sys admin class you must have some info :D
–bha
> how do i find out current runlevel as well as last runlevel?
Use who -r command
$ who -r
run-level 2 Oct 17 18:21 last=S
Thanks matt :) We don’t update our blog everyday, as and when event occurs in our life it is get documented here.
I appreciate your post.
you have a little typo: Genome
if the typo is fixed you can delete my comment.