File: console-log.conf.5

package info (click to toggle)
console-log 2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 144 kB
  • sloc: python: 270; makefile: 17; sh: 9
file content (213 lines) | stat: -rw-r--r-- 7,765 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
.\" -*- mode: troff; coding: utf-8 -*-
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
.\"
.\" Standard preamble:
.\" ========================================================================
.de Sp \" Vertical space (when we can't use .PP)
.if t .sp .5v
.if n .sp
..
.de Vb \" Begin verbatim text
.ft CW
.nf
.ne \\$1
..
.de Ve \" End verbatim text
.ft R
.fi
..
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
.ie n \{\
.    ds C` ""
.    ds C' ""
'br\}
.el\{\
.    ds C`
.    ds C'
'br\}
.\"
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\"
.\" If the F register is >0, we'll generate index entries on stderr for
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
.\" entries marked with X<> in POD.  Of course, you'll have to process the
.\" output yourself in some meaningful fashion.
.\"
.\" Avoid warning from groff about undefined register 'F'.
.de IX
..
.nr rF 0
.if \n(.g .if rF .nr rF 1
.if (\n(rF:(\n(.g==0)) \{\
.    if \nF \{\
.        de IX
.        tm Index:\\$1\t\\n%\t"\\$2"
..
.        if !\nF==2 \{\
.            nr % 0
.            nr F 2
.        \}
.    \}
.\}
.rr rF
.\" ========================================================================
.\"
.IX Title "CONSOLE-LOG.CONF 5"
.TH CONSOLE-LOG.CONF 5 2025-06-23 "perl v5.40.1" "User Contributed Perl Documentation"
.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
.\" way too many mistakes in technical documents.
.if n .ad l
.nh
.SH NAME
console\-log.conf \- Main configuration file for console\-log
.SH DESCRIPTION
.IX Header "DESCRIPTION"
console-log keeps logfile pagers open on virtual consoles.
/etc/console\-log.conf is the configuration file controlling which log
file is opened on which tty.
.PP
Empty lines and lines starting with "#" are ignored.
.PP
The rest of the file consists of stanzas consisting of lines formed as
a single keyword and multiple values. Each stanza describes one pager
being started. Stanzas are separated with blank lines. Other keywords
preceded by $ are interpolated if the other keyword is set in the same
stanza _before_ the current line.
.IP tty 4
.IX Item "tty"
is the number of the tty the log pager should be started on. Choose a
tty that has a virtual console. This is a mandatory setting.
.IP chvt 4
.IX Item "chvt"
If chvt is yes, the system's console will be switched to the tty of
this stanza on startup. Default is no.
.IP file 4
.IX Item "file"
is a list of absolute paths to log files to display. The first file
that is either a plain file or a symlink is displayed. The file name
must not contain any spaces. This is a mandatory setting.
.IP "user, group" 4
.IX Item "user, group"
If user and/or group is/are given, uid/gid will be changed to the given values
before invoking the log pager. User needs to be in group in
/etc/group. If no user is given, the pager will be run as
the default user/group set at build time.
.IP maxfilesize 4
.IX Item "maxfilesize"
If the file to be paged exceeds the configured size, no pager is
started to avoid memory overflow. Value given in bytes. Default is
7000000. Additionally, ulimit \-v is set to twice this value.
.IP locscript 4
.IX Item "locscript"
is the absolute path to a bash shell script that will be sourced
before the pager is being started. The script will receive the file
path as a parameter and can set environment variables that can
influence the pager.
.IP pager 4
.IX Item "pager"
is the actual program that will be invoked to display the file.
Currently less is the only pager supported and is therefore also the
default. It gets invoked with secure settings and follow mode
activated. If you want to use a different pager, you need to manually
adapt /usr/share/console\-log/logpager. Please submit patches that
extend logpager's support for other pagers via the BTS.
.SH EXAMPLE
.IX Header "EXAMPLE"
The default config file
.PP
.Vb 4
\& tty 9
\& chvt yes
\& file /var/log/syslog
\& group adm
\&
\& tty 8
\& file /var/log/exim4/mainlog /var/log/exim/mainlog /var/log/mail.log
\& group adm
.Ve
.PP
will start one log pager for the first file found from
/var/log/exim4/mainlog, /var/log/exim/mainlog and /var/log/mail.log,
and one log pager for /var/log/syslog, and will chvt to tty9.
.PP
If a file cannot be read by the user specified in the config file, the
init script will complain. You can either change the log file
permissions or put the user account in the appropriate group.  For
example, if /var/log/exim/mainlog is only readable by group mail, you
can either change the log file group to adm (make sure to adapt the
log file creation/rotation process as well), run the pager as a user
that can access the log file, or else put the user account into group
mail. Making the file readable for the default account is the
preferred way to solve this issue since it introduces the least
security risk.
.SH "CONFIGURING THE PAGER"
.IX Header "CONFIGURING THE PAGER"
All configuration options are exported and therefore handed down to
the logpager script. You can use this to configure your pager. For
example, the logpager script set LESSSECURE to the value of the
less_lessecure configuration option and LESS to the value off the
less_opts configuration option.
.PP
This mechanism can be used in any pager extension called from the
logpager script.
.SH "CONFIGURING THE LESS PAGER"
.IX Header "CONFIGURING THE LESS PAGER"
For configuring the less pager, the following options are implemented:
.IP less_lesssecure 4
.IX Item "less_lesssecure"
controls the value of the LESSSECURE environment variable for the less
process. Default is 1
.IP less_opts 4
.IX Item "less_opts"
controls the value of the LESS environment variable for the less
process. Default is "\-\-LONG\-PROMPT \-\-chop\-long\-lines \-\-jump\-target=10
\&\-\-max\-forw\-scroll=100 \-\-window=\-4". If you want your pager to
automatically re-read the file after possible log rotation (#111272),
you might want to add \-\-follow\-name to this default. \-\-follow\-name
might get added to the default in later version.
.IP less_lesskey 4
.IX Item "less_lesskey"
controls the value of the LESSKEY environment variable for the less
process. Default is /usr/lib/console\-log/lesskey, which does not exist
in the package currently, and LESSKEY is only set if less_lesskey
points to an existing file.
.IP less_term 4
.IX Item "less_term"
controls the value of the TERM environment variable for the less
process. Default is linux.
.SH "SUPPORTING YOUR FAVORITE PAGER"
.IX Header "SUPPORTING YOUR FAVORITE PAGER"
If you fancy a different pager, please by all means extend the
logpager script to support your pager by adding an appropriate part to
the case "$PAGER" part of the script. If you want your pager to be
configurable via console_log.conf, the convention is to prefix your
pager's configuration variables with the name of your pager, e.g.
mypager_mycooloption.
.PP
Make sure to also make the init script unset each variable that gets
used in your logpager patch inside the do_from_config function, or a
variable set in a previous console\-log.conf stanza will also be set in
all following ones until you set a different value.
.PP
Please consider submitting your patch for inclusion in the package via
the Debian BTS.
.SH FILES
.IX Header "FILES"
/etc/console\-log.conf
.PP
/usr/share/console\-log/logpager
.SH BUGS
.IX Header "BUGS"
Many. Be prepared to debug.
.SH AUTHOR
.IX Header "AUTHOR"
This manpage was written by Marc Haber for console-log in Debian/GNU
Operating System.
.SH THANKS
.IX Header "THANKS"
Thanks to Ivan Frederiks for pointing me towards less \-\-follow\-name.
.SH "SEE ALSO"
.IX Header "SEE ALSO"
/etc/init.d/console\-log