Projekt

Allgemein

Profil

Config setterm » Historie » Version 1

Jeremias Keihsler, 13.01.2017 11:34

1 1 Jeremias Keihsler
h1. Configure terminal via setterm
2
3
h2. Requirements
4
5
To configure the terminal via @setterm@ you will need the following:
6
* a installed and supported operating system (e.g. CentOS)
7
* root-access
8
9
h2. Preliminary Note
10
11
While in the past it was graceful to the crt-monitor not to display the same content for ages this behaviour is not necessary any more, especially with virtual screens
12
13
Therefore we disable powersaving and blanking of the screen.
14
15
This information is taken from [[http://www.cyberciti.biz/tips/linux-disable-screen-blanking-screen-going-blank.html]] other @setterm@ related information may be found also in the setterm and terminfo man pages.
16
17
h2. Configure terminal
18
19
h3. short version
20
21
add following to @/boot/grub/menu.lst@ at @kernel@
22
<pre><code class="bash">
23
consoleblank=0
24
</code></pre>
25
26
h3. long version
27
28
<pre><code class="bash">
29
setterm -powersave off -blank 0
30
</code></pre>
31
If it dumps back you with an error that read as follows:
32
@cannot (un)set powersave mode@
33
34
You need to shutdown X window system and rerun the above command. Better, add following two commands to your ~/.xinitrc file:
35
<pre><code class="bash">
36
setterm -blank 0 -powersave off -powerdown 0
37
xset s off
38
</code></pre>
39
40
You can verify what timeout the kernel uses for virtual console blanking via:
41
42
<pre>
43
$ cat /sys/module/kernel/parameters/consoleblank
44
600
45
</pre>
46
47
This file is read-only and the timeout is specified in seconds. The current default seems to be 10 minutes.
48
49
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).
50
51
<pre>
52
$ setterm -blank VALUE
53
</pre>
54
55
Where the new VALUE is specified in minutes. A value of 0 disables blanking:
56
57
<pre>
58
$ cat /sys/module/kernel/parameters/consoleblank
59
600
60
$ setterm -blank 0
61
$ cat /sys/module/kernel/parameters/consoleblank
62
0
63
</pre>
64
65
setterm has other powersaving related options, the must useful combination seems to be:
66
67
<pre>
68
$ setterm -blank 0 -powersave off
69
</pre>
70
71
Thus to permanently/automatically disable virtual console blanking on startup you can either:
72
73
* add consoleblank=0 to the kernel parameters (edit grub configuration)
74
* add the setterm -blank 0 command to an rc-local or equivalent startup script
75
* add the setterm output to /etc/issue since /etc/issue is output on every virtual console:
76
<pre>
77
# setterm -blank 0 >> /etc/issue
78
</pre>
79
80
Choose one alternative from the above.