| CONSOLE-LOG.CONF(5) | Debian GNU/Linux | CONSOLE-LOG.CONF(5) |
console-log.conf - Main configuration file for console-log
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.
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.
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.
For configuring the less pager, the following options are implemented:
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.
/etc/console-log.conf
/usr/share/console-log/logpager
Many. Be prepared to debug.
This manpage was written by Marc Haber for console-log in Debian/GNU Operating System.
Thanks to Ivan Frederiks for pointing me towards less --follow-name.
/etc/init.d/console-log
| 2021-01-04 | console-log |