CentOS / RHEL 6 : how to start the services interactively during boot (to disable/abort some services)

There is an option with RHEL / CentOS 6 to start the services interactively during system boot up. We can use it to troubleshoot any booting issues related to services. By default, this feature is not available and you need to enable it using either of the 2 methods described below.

Method 1 – Using Keypress during boot

This method involves editing the /etc/sysconfig/init file. Assign value “yes” to the parameter PROMPT in order to boot system interactively. For example :

# vi /etc/sysconfig/init
# Set to anything other than 'no' to allow hotkey interactive startup...
PROMPT=yes

The above parameter is set to “yes” by default. Once you have confirmed that it is set to yes, you have to interrupt the booting process using the key “i” a couple of time and start the services interactively.

Type “Y” to allow a service to start, “N” to stops a service from starting and “C” to exit from the interactive startup.

Method 2 – adding kernel parameter

Alternatively, we can append “confirm” to the end of the kernel boot line either during boot (at GRUB) or in the /etc/grub.conf file to have it persistent.

1. add kernel parameter in GRUB during boot
To do this, restart the system and when the GRUB splash screen comes:

1. Select/highlight the kernel you wish to boot using the up/down arrow keys. In my case, I have only one kernel to select :)

2. Press the e key to edit the entry. Select/highlight the line starting with the word kernel.

3. Press the e key to edit the line. Add confirm word to the end of line. Press ENTER to accept the changes.

7. Press the b key to boot the kernel with the modified command line. You should enter into the interactive mode while starting services.

2. Add kernel parameter in /etc/grub.conf file
Another way to add kernel parameter is to edit the /etc/grub.conf file and add the confirm at the end of the kernel line which you want to boot up with. For example :

kernel /vmlinuz-2.6.32-504.el6.x86_64 ro root=/dev/mapper/vg_os-lv_os rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=vg_os/lv_os  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet confirm

Reboot the system to check if the settings have been applied.

Related Post