Posts

Showing posts with the label Inittab

How to change default run-level in RHEL or CentOS 7

How to change default run-level in RHEL or CentOS 7 There is change in process to setup default run-levels from init 3 (multi-user) to init 5 (Graphical) and vice versa. If we see "/etc/inittab" file it's been changed from RHEL/CentOS 6.x to 7.x. [root@localhost ~]# cat /etc/inittab # inittab is no longer used when using systemd. # # ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM. # # Ctrl-Alt-Delete is handled by /usr/lib/systemd/system/ctrl-alt-del.target # # systemd uses 'targets' instead of runlevels. By default, there are two main targets: # # multi-user.target: analogous to runlevel 3 # graphical.target: analogous to runlevel 5 # # To view current default target, run: # systemctl get-default # # To set a default target, run: # systemctl set-default TARGET.target # To check what is the default run-level configured currently : [root@localhost ~]# ls -l /lib/systemd/system/default.target l...

Working with "/etc/inittab" file

Image
Working with /etc/inittab file to manage defualt runlevels. Here we will learn, 1. How to set defualt Runlevel ? 2. How to disable immidiate shutdown by Pressing "Ctrl + Alt + Delete" ? 3. How to set immidiate shutdown by Pressing "Ctrl + Alt + Delete" for only Particular users.? 1.Types of Runlevels; 0 - Halt Or Shutdown #Dont set it as defualt 1 - Single User Mode # Used for maintainence purpose 2 - Multiuser, without Networking 3 - Full multiuser with Networking #Can be used as defualt runlevel 4 - Not Defined #Can be customize as per user 5 - X11 (GUI) #Always defualt runlevel 6 - Reboot #Dont set it as defualt To make any runlevel defualt, Edit /etc/inittab file & search for "id:5:initdefualt:" line, here just replace Runlevel 5 with any other runlevel like "3" and save file. So now when you restart it again it'll boot in Runlevel 3. 2. How to disable immidiate shutdown by Pressing "Ctrl ...