2

I have recently added consoleblank=0 to my kernel boot line in order to disable the console screensaver on hosts that are either VMs are are connected to some sort of KVM.

This obviously only takes effect on reboot. I would like to make this change for all my running systems without rebooting.

There are a few existing answers that deal with this in terms of the setterm command, but they all say that it must be run on the VT itself. I'd like to apply this change to a few hundred machines and I want to avoid having to log into each one's console by hand and run this command.

How can I disable consoleblank across my server estate without either (a) rebooting or (b) logging into each console by hand?

I'm running a mixture of RHEL 6 and RHEL 7.

2
  • I would have thought running TERM=linux setterm -blank 0 < /dev/tty1 > /dev/tty1 as root would work, but apparently not... Commented Jun 14, 2016 at 8:25
  • @StephenKitt Doesn't it? TERM=linux setterm --blank force </dev/tty1 works for me. I don't have the patience to test the timeout feature. Commented Jun 14, 2016 at 20:44

1 Answer 1

1

man console_codes lists the escape sequences recognised by the console. You can set a timeout of 0 with

sudo sh -c 'echo -e "\033[9;0]" >/dev/console'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .