Default config uses bad check_mail setting.
Bug #344163 reported by
Jeremy Thurgood
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
multitail (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: multitail
The default configuration for multitail has the check_mail option set to "5". This causes multitail to look for /var/mail/$USER, which does not exist on any Ubuntu machine I've used.
Description: Ubuntu 8.04.2
Release: 8.04
Package: multitail
Version: 5.2.0-1
(The same issue exists in 5.2.2-1, which is the version Intrepid and Jaunty use.)
The fix is to set check_mail to "0" in the default configuration file, which disables mail checking. (Personally, I don't why a log tailer needs to check my mail anyway.)
description: | updated |
To post a comment you must log in.
If no spool file is set, the check_mail feature also causes multitail to wake up every 10 milliseconds.
This bug is easily verified using strace(1) or powertop(1):
1. unset the MAIL environmental variable (e.g. using `env -u MAIL`);
2. run multitail with the default setting of 'check_mail:5' in /etc/multitail. conf; and
3. use strace or powertop to see that multitail wakes up every 10ms because of timeout on select(2).
4. Then add 'check_mail:0' to ~/.multitailrc;
5. run multitail again; and
6. use strace or powertop to see that multitail calls select(2) without a timeout.
The concerned routines are wait_for_keypress in mt.c and do_check_for_mail in misc.c. wait_for_keypress contains the select(2) loop for multitail. It also calls do_check_for_mail in every iteration of the select(2) loop. wait_for_keypress checks msf_last_check in computing the time until the mail next needs to be checked, and it uses this time as an upper bound for the timeout for the select(2) call. do_check_for_mail is supposed to reset msf_last_check to the current time whenever it checks mail. The problem is that if mail_spool_file is NULL, do_check_for_mail returns immediately. Thus msf_last_check is never updated, and wait_for_keypress always gives select(2) a very short timeout.
Should I open a separate bug report regarding the excessive wakeups? I have a patch for this issue.