| 1 |
|
| 2 |
.TH CONSOLE-LOG.CONF 5 2025-06-23 "" "console-log" |
| 3 |
.SH NAME |
| 4 |
console\-log.conf \- Main configuration file for console\-log |
| 5 |
.SH DESCRIPTION |
| 6 |
console-log keeps logfile pagers open on virtual consoles. |
| 7 |
.I /etc/console\-log.conf |
| 8 |
is the configuration file controlling which log file is opened on which tty. |
| 9 |
.PP |
| 10 |
Empty lines and lines starting with a hash sign (#) are ignored. |
| 11 |
.PP |
| 12 |
The rest of the file consists of stanzas composed of lines |
| 13 |
formed with a single keyword followed by one or more values. |
| 14 |
Each stanza describes one pager being started. |
| 15 |
Stanzas are separated by blank lines. |
| 16 |
.PP |
| 17 |
.TP |
| 18 |
.B tty |
| 19 |
The number of the tty the log pager should be started on. |
| 20 |
Choose a tty that has a virtual console. |
| 21 |
This is a mandatory setting. |
| 22 |
.TP |
| 23 |
.B chvt |
| 24 |
If |
| 25 |
.B chvt |
| 26 |
is |
| 27 |
.I yes, |
| 28 |
the system's console will be switched to the tty of this stanza on startup. |
| 29 |
Default is |
| 30 |
.I no. |
| 31 |
.TP |
| 32 |
.B file |
| 33 |
A list of absolute paths to log files to display. |
| 34 |
The first file that is either a plain file or a symlink is displayed. |
| 35 |
The file name must not contain any spaces. |
| 36 |
This is a mandatory setting. |
| 37 |
.TP |
| 38 |
.B user, group |
| 39 |
If |
| 40 |
.B user |
| 41 |
and/or |
| 42 |
.B group |
| 43 |
are given, |
| 44 |
the UID/GID will be changed to the given values before invoking the log pager. |
| 45 |
User must be in group as defined in |
| 46 |
.I /etc/group. |
| 47 |
If no user is given, the pager will run as the default user/group set at build time. |
| 48 |
Use caution when specifying privileged users or groups. |
| 49 |
.TP |
| 50 |
.B maxfilesize |
| 51 |
If the file exceeds the configured size, no pager is started to reduce memory usage. |
| 52 |
Value is given in bytes. |
| 53 |
Default is 7000000. |
| 54 |
The service is started with |
| 55 |
.BR MemoryMax = |
| 56 |
twice this value. |
| 57 |
.TP |
| 58 |
.B locscript |
| 59 |
This option was removed in console-log 2.0. |
| 60 |
If you used this, please file a bug and describe your use case. |
| 61 |
.TP |
| 62 |
.B pager |
| 63 |
The program used to display the file. |
| 64 |
Currently, |
| 65 |
.B less |
| 66 |
is the only supported (and default) pager. |
| 67 |
It is invoked with secure settings and follow mode activated. |
| 68 |
The codebase allows for other pagers. |
| 69 |
Please submit patches to add support via the BTS. |
| 70 |
|
| 71 |
.SH EXAMPLE |
| 72 |
The default config file: |
| 73 |
.PP |
| 74 |
.nf |
| 75 |
tty 9 |
| 76 |
chvt yes |
| 77 |
file /var/log/syslog |
| 78 |
group adm |
| 79 |
|
| 80 |
tty 8 |
| 81 |
file /var/log/exim4/mainlog /var/log/exim/mainlog /var/log/mail.log |
| 82 |
group adm |
| 83 |
.fi |
| 84 |
.PP |
| 85 |
This will start: |
| 86 |
.IP \(bu 2 |
| 87 |
One pager for the first readable file from |
| 88 |
.I /var/log/exim4/mainlog, |
| 89 |
.I /var/log/exim/mainlog, |
| 90 |
or |
| 91 |
.I /var/log/mail.log |
| 92 |
on tty 8. |
| 93 |
.IP \(bu |
| 94 |
One pager for |
| 95 |
.I /var/log/syslog |
| 96 |
on tty9. |
| 97 |
.IP \(bu |
| 98 |
The active virtual console will switch to tty9 at boot. |
| 99 |
.PP |
| 100 |
If a file cannot be read by the user specified, |
| 101 |
the pager will not run. |
| 102 |
You may: |
| 103 |
.IP \(bu 2 |
| 104 |
Change the file permissions |
| 105 |
.IP \(bu |
| 106 |
Adjust log rotation policies |
| 107 |
.IP \(bu |
| 108 |
Use a different user/group |
| 109 |
.IP \(bu |
| 110 |
Add the user to the appropriate group (e.g., mail or adm) |
| 111 |
.PP |
| 112 |
The recommended solution is to make the file readable by the default user, |
| 113 |
as this poses the least security risk. |
| 114 |
|
| 115 |
.SH CONFIGURING THE PAGER |
| 116 |
All configuration options are handed to the |
| 117 |
.B logpager |
| 118 |
wrapper script. |
| 119 |
You can use this to customize your pager. |
| 120 |
For example, |
| 121 |
the |
| 122 |
.B logpager |
| 123 |
script sets the |
| 124 |
.B LESSSECURE |
| 125 |
environment variable from |
| 126 |
.B less_lesssecure |
| 127 |
and |
| 128 |
.B LESS |
| 129 |
from |
| 130 |
.B less_opts. |
| 131 |
.PP |
| 132 |
This mechanism applies to any pager invoked by |
| 133 |
.B logpager. |
| 134 |
|
| 135 |
.SH CONFIGURING THE LESS PAGER |
| 136 |
For configuring |
| 137 |
.B less, |
| 138 |
the following options are available: |
| 139 |
.TP |
| 140 |
.B less_lesssecure |
| 141 |
Sets the |
| 142 |
.B LESSSECURE |
| 143 |
environment variable. |
| 144 |
Default: 1. |
| 145 |
.TP |
| 146 |
.B less_follow_name |
| 147 |
Adds |
| 148 |
.B \-\-follow\-name |
| 149 |
to the less command line. |
| 150 |
This may be better in handling log rotation, |
| 151 |
but might lose the capability to scroll back and |
| 152 |
to have search results hilighted. |
| 153 |
.TP |
| 154 |
.B less_opts |
| 155 |
Sets the |
| 156 |
.B LESS |
| 157 |
environment variable. |
| 158 |
Default: |
| 159 |
.B --LONG-PROMPT |
| 160 |
.B --chop-long-lines |
| 161 |
.B --IGNORE-CASE |
| 162 |
.B --jump-target=10 |
| 163 |
.B --max-forw-scroll=100 |
| 164 |
.B --window=-4 |
| 165 |
.B --status-column. |
| 166 |
To handle log rotation (#111272), add |
| 167 |
.B --follow-name. |
| 168 |
This may become the default in future versions. |
| 169 |
.TP |
| 170 |
.B less_lesskey |
| 171 |
Sets the |
| 172 |
.B LESSKEY |
| 173 |
environment variable. |
| 174 |
Default is |
| 175 |
.I /usr/lib/console\-log/lesskey, |
| 176 |
which currently does not exist. |
| 177 |
The variable is only set if the file exists. |
| 178 |
.TP |
| 179 |
.B less_term |
| 180 |
Sets the |
| 181 |
.B TERM |
| 182 |
environment variable. |
| 183 |
Default: |
| 184 |
.I linux. |
| 185 |
|
| 186 |
.SH SUPPORTING YOUR FAVORITE PAGER |
| 187 |
If you want to use a different pager, file a wishlist bug— |
| 188 |
ideally with a patch. |
| 189 |
Likely, you just need to create a new file in: |
| 190 |
.B src/console_log/pagers |
| 191 |
.PP |
| 192 |
You can model it after |
| 193 |
.B less.py. |
| 194 |
If your pager should be configurable via |
| 195 |
.I console-log.conf, |
| 196 |
prefix configuration variables with your pager name. |
| 197 |
Example: |
| 198 |
.B mypager_mycooloption. |
| 199 |
|
| 200 |
.SH FILES |
| 201 |
.I /etc/console\-log.conf |
| 202 |
|
| 203 |
.SH BUGS |
| 204 |
Many. Be prepared to debug. |
| 205 |
|
| 206 |
.SH AUTHOR |
| 207 |
Marc Haber |
| 208 |
|
| 209 |
.SH THANKS |
| 210 |
Thanks to Ivan Frederiks for pointing out |
| 211 |
.B less --follow-name. |