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
|
=head1 NAME
console-log.conf - Main configuration file for console-log
=head1 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.
Empty lines and lines starting with "#" are ignored.
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.
=over
=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.
=item chvt
If chvt is yes, the system's console will be switched to the tty of
this stanza on startup. Default is no.
=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.
=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.
=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.
=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.
=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.
=back
=head1 EXAMPLE
The default config file
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
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.
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.
=head1 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.
This mechanism can be used in any pager extension called from the
logpager script.
=head1 CONFIGURING THE LESS PAGER
For configuring the less pager, the following options are implemented:
=over
=item less_lesssecure
controls the value of the LESSSECURE environment variable for the less
process. Default is 1
=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.
=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.
=item less_term
controls the value of the TERM environment variable for the less
process. Default is linux.
=back
=head1 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.
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.
Please consider submitting your patch for inclusion in the package via
the Debian BTS.
=head1 FILES
/etc/console-log.conf
/usr/share/console-log/logpager
=head1 BUGS
Many. Be prepared to debug.
=head1 AUTHOR
This manpage was written by Marc Haber for console-log in Debian/GNU
Operating System.
=head1 THANKS
Thanks to Ivan Frederiks for pointing me towards less --follow-name.
=head1 SEE ALSO
/etc/init.d/console-log
|