On my systems (various releases of RedHat Enterprise Linux), I have found that different approaches are needed.
For my RHEL 5 and 6 systems, I am able to add the line
/bin/setterm -blank 0 -powerdown 0 -powersave off
/etc/rc.local. This disables the console screen blanking at system startup.
I found that this does not work on RHEL 7 systems. On RHEL7, running setterm from rc.local causes an error to be generated:
setterm: $TERM is not defined.
The command works from an interactive shell, where $TERM is defined (as
linux). If I force setterm to use it:
/bin/setterm -term linux -blank 0 -powerdown 0 -powersave off
Then I get a different error:
setterm: cannot (un)set powersave mode: Inappropriate ioctl for device
Even though the same command works fine from an interactive session. Setting the
consoleblank kernel parameter worked.
On RHEL7, edit
/etc/default/grub and append
consoleblank=0 to the
GRUB_CMDLINE_LINUX parameter. Then run
grub2-mkconfig -o /boot/grub2/grub.cfg and reboot.
I haven't tried setting
consoleblank on RHEL5 or 6.