Why?


Search This Blog

Tuesday, May 26, 2015

Centos 6.6 prevent console from going blank

Centos 6.6 prevent console from going blank

I want to have my console to go blank when NOT logged in, but stay on when I am logged in.

In my home directory I edit the .bash_profile file,

# cd $HOME

# vi .bash_profile


and add the following to the end.

setterm -blank 0 -powerdown 0


To turn console blanking off, if logged in or not.

# vi /etc/default/grub

append consoleblank=0 to your GRUB_CMDLINE_LINUX= line.

Example:

GRUB_TIMEOUT=5
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
#GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto rhgb quiet"
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap crashkernel=auto consoleblank=0"
GRUB_DISABLE_RECOVERY="true"
GRUB_CMDLINE_LINUX_DEFAULT="video=1024x768"
GRUB_GFXMODE=1024x768
GRUB_GFXPAYLOAD_LINUX=keep


Then for BIOS machines using grub2

# grub2-mkconfig -o /boot/grub2/grub.cfg

If you have UEFI-based machine then

# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg

Now reboot 

No comments:

Post a Comment