Turn off monitor (energy saving) while in text console mode (in Linux)

How to configure Linux text console to automatically turn of the monitor after some time?

And by "text console" I mean that thing that you get on ctrl+alt+F[1-6], which is what you get whenever X11 is not running. And, no, I'm not using any framebuffer console (it's a plain, good and old 80x25 text-mode).

Many years ago, I was using Slackware Linux, and it used to boot up in text-mode. Then you would manually run startx after the login. Anyway, the main login "screen" was the plain text-mode console, and I remember that the monitor used to turn off (energy saving mode, indicated by a blinking LED) after some time.

Now I'm using Gentoo, and I have a similar setup. The machine boots up in text-mode, and only rarely I need to run startx. I say this because this is mostly my personal Linux server, and there is no need to keep X11 running all the time. (which means: I don't want to use GDM/KDM or any other graphical login screen)

But now, in this Gentoo text-mode console, the screen goes black after a while, but the monitor does not enter any energy-saving mode (the LED is always lit). Yes, I've waited long enough to verify this.

Thus, my question is: how can I configure my current system to behave like the old one? In other words, how to make the text console trigger energy-saving mode of the monitor?

(maybe I should (cross-)post this question to https://unix.stackexchange.com/ )


Solution 1:

I'm not totally sure, but if you have setterm -blank <n> set in one of your initialization files, try something like:

setterm -blank 10 -powerdown 15

The vbetool command can be handy sometimes:

vbetool dpms off

You will need to have APM or ACPI enabled in your kernel.

See also:

  • Gentoo Power Management Guide
  • man setterm
  • man vbetool

Solution 2:

Over the past week, I have been trying to compile a minimal kernel for an old machine, and I've noticed the exact same behavior you are seeing with your new Gentoo set up when I use ACPI, and the behavior you saw with your Slackware when I use APM.

Specifically, if I compile a kernel with ACPI but not APM:

  • Console goes blank, but the display never power downs.
  • However, you have control over ACPI events (e.g., pressing the power button initiates the Linux shutdown sequence).

If I compile with only APM, no ACPI:

  • When the console goes blank, the display powers down.
  • Pressing the power button cuts power to the system immediately.

I made various attempts (setterm, vbetools) to get the screen to power-down during console blanking with ACPI, but can't seem to do it. If anyone has any ideas, please let me know.

Also, I don't think you have to re-compile your kernel to repeat my experiment. I believe most default kernels have both ACPI and APM available (as modules), and defaults to ACPI (if the hardware supports it). To try disabling ACPI, you should be able to pass in acpi=off to your kernel during boot up.

Per the Linux kernel documentation:

acpi=       [HW,ACPI,X86]
        Advanced Configuration and Power Interface
        Format: { force | off | strict | noirq | rsdt }
        force -- enable ACPI if default was off
        off -- disable ACPI if default was on
        noirq -- do not use ACPI for IRQ routing
        strict -- Be less tolerant of platforms that are not
            strictly ACPI specification compliant.
        rsdt -- prefer RSDT over (default) XSDT
        copy_dsdt -- copy DSDT to memory

        See also Documentation/power/pm.txt, pci=noacpi

(Source: http://www.kernel.org/doc/Documentation/kernel-parameters.txt)