Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm running linux clusters, mostly on SLES10. The servers are mostly blades, accessed via remote console. There is a real console in the server room, but switched off.

I would like to disable the screen blanking as it serves no purpose and is a nuisance. You have to press key to see if you are connected which is a pain. We are running in runlevel 3, so the console is in text mode, no X11 involved.

share|improve this question
add comment

7 Answers

If you only want to prevent screen blank out after user login, then just need to append setterm -powersave off -blank 0 to $HOME/.bash_profile of respective users.

share|improve this answer
add comment

/usr/bin/setterm -powerdown 0 might help also

share|improve this answer
add comment

You can verify what timeout the kernel uses for virtual console blanking via:

$ cat /sys/module/kernel/parameters/consoleblank
600

This file is read-only and the timeout is specified in seconds. The current default seems to be 10 minutes.

You can change that value with entering the following command on a virtual console (if you are inside an xterm you have to change to a virtual console via hitting e.g. Ctrl+Alt+F1).

$ setterm -blank VALUE

Where the new VALUE is specified in minutes. A value of 0 disables blanking:

$ cat /sys/module/kernel/parameters/consoleblank
600
$ setterm -blank 0
$ cat /sys/module/kernel/parameters/consoleblank
0

setterm has other powersaving related options, the must useful combination seems to be:

$ setterm -blank 0 -powersave off

Thus to permanently/automatically disable virtual console blanking on startup you can either:

  1. add consoleblank=0 to the kernel parameters (edit grub configuration)
  2. add the setterm -blank 0 command to an rc-local or equivalent startup script
  3. add the setterm output to /etc/issue since /etc/issue is output on every virtual console:

    # setterm -blank 0 >> /etc/issue

Choose one alternative from the above.

share|improve this answer
1  
PS: On a Ubuntu 11.10 system (Thinkpad X200) I noticed a bug where the console blanking by the kernel interferes with a running X11 session. That means that exactly 10 minutes after the last key press the X11 display blanks and you have to cycle to a virtual console to get the X11 screen back (very annoying during e.g. video playback). This is independent of DPMS/screensaver related settings under X11 (think xset etc.). Thus, disabling the virutal console blanking like described above is a quick workaround for affected systems. –  maxschlepzig Feb 18 '12 at 21:13
add comment

The only permanent solution is to add consoleblank=0 to the kernel command-line. You can view the value (which defaults to 600 seconds) in:

/sys/module/kernel/parameters/consoleblank

(note that the file is read-only). The only way to change the value of consoleblank is to reboot with the new kernel command-line option.

share|improve this answer
1  
The last sentence is wrong - you don't need to reboot to change the value of consoleblank. See my answer. –  maxschlepzig Feb 18 '12 at 13:10
    
I have not found setterm -blank to work reliably. It sometimes seems to get reset after logout or switching to other virtual terminals. –  amcnabb Mar 13 '12 at 18:10
add comment

According to : https://wiki.archlinux.org/index.php/Display_Power_Management_Signaling#DPMS_Interaction_in_a_console_with_setterm

Prevent screen from turning off (in console)

$ setterm -blank 0 -powerdown 0

Alternatively you can disable console blanking permanently using the following command:

# echo -ne "\033[9;0]" >> /etc/issue

share|improve this answer
1  
second solution works like a charm on Marvell ARM Debian. All other solutions do nothing. –  Alexey Sviridov Oct 22 '12 at 12:04
add comment
up vote 8 down vote accepted

I've implemented and tested the following configuration, which works fine on sles10, my workhorse at the moment.

In

/etc/init.d/boot.local

add

setterm -blank

it looks like that is all it takes. Thanks for Uku Loskit and Gilles for the push in the right direction.

share|improve this answer
1  
I have edited your Answer mercilessly, so don't hesitate to rollback if you don't like it. Also, please Accept your answer because it's the actual solution. You should not Accept an Answer just because you are grateful it led you to the actual answer, if there is actually a better Answer. –  Tshepang Mar 1 '11 at 5:39
    
Sorry, like the original version better. –  markus_b Mar 2 '11 at 19:07
add comment

Try using this:

setterm -blank
share|improve this answer
    
I want this to be in effect automatically after boot, without logging in. There is nobody who will type the command ! Sometimes the screen blanks even during boot, for example if there is a SAN timeout. –  markus_b Feb 25 '11 at 0:28
1  
@markus_b: So add this command to an init script (something like /etc/init/markus-console.conf if you use Upstart, or /etc/init.d/markus-console.sh plus symlinks in /etc/rd?.d for SysVinit, I don't know the actual SuSE locations). –  Gilles Feb 25 '11 at 0:35
    
File that under "things you can't do with systemd". –  mattdm Feb 25 '11 at 0:57
1  
@mattdm, not true - systemd usually comes with a rc-local compatibility service - or you can easily add custom services ... –  maxschlepzig Feb 18 '12 at 12:46
2  
@mattdm Why wouldn't you be able to just write a unit that runs that command? –  Demizey Mar 4 '13 at 12:39
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.