1

Using an older laptop as a small server with no graphical UI/login, it has an agetty running on the system console, i.e. the laptop screen.

Since I login almost always via network, there is no point having the screen switched on. It should be off until I hit some key. Can this be done?

The following are non-options:

  • not running agetty, because I want to keep it as a fallback in case I cannot log in over the net anymore.
  • setterm cannot be used, because I would have to log in first
  • setterm --blank </dev/tty1 says "terminal xterm-256color does not support --blank" :-/
  • vbetool linked in some answer wrecks the display to show garbage and cannot switch it on any more on my laptop.

This answer says the console should only be started on demand, but clearly when logging in via ssh I see two agetty processes and the laptop screen is on showing the login prompt.

Harald
  • 898

1 Answers1

1

(Based on this question & answers)

This worked for me: (sets blank timeout to 1 minute)

TERM=linux setterm --blank 1 < /dev/tty1 > /dev/tty1

If you can add kernel startup commandline parameters, you can also add: (sets blank timeout to 30 seconds)

consoleblank=30

If you have Fedora, the above can be set in /etc/default/grub by modifying the containing GRUB_CMDLINE_LINUX to contain the above (keeping the existing things already there), for example:

GRUB_CMDLINE_LINUX="resume=UUID=073539e3-5130-4a2d-883b-75214a83847c quiet consoleblank=30"

Then (still assuming you have Fedora) update the grub configuration file using: (as documented here)

sudo grub2-mkconfig -o /boot/grub2/grub.cfg
Jonas Berlin
  • 1,124
  • Yes, the consoleblank solution is what I have and it seems to work. I wish I could test whether the screen is really blanked (black, off) without lifting the lid :-/ – Harald Nov 13 '23 at 19:19