util-linux's /bin/login sets MAIL to /var/mail/loginname and provides
no override or way to fix that.
This is a clear problem when /var/mail is automounted, and the
automount hangs, because I can't even log in as root at this point.
I've binary patched my /bin/login to replace /var/mail with /var/tmp,
but it should parse some configuration file to allow setting
_PATH_MAILDIR to a different value than the compiled in one.
Yes, I could put a .hushlogin for everyone, but I don't want to remove
the last login time output
Another option would be to tell login to stop stating /var/mail
(i.e. show last login time, but not whether I have unread mail, which
I don't care about and will hang my login if NFS is hosed)
It sounds like the right solution is correct configuration of NFS
mounts. It'd take a non-trivial patch to make the suggested change,
and making only the symptoms of the problem go away doesn't really
accomplish much in the end.
the correct configuration for /var/mail _is_ "hard,intr,noac" for the
majority of sites.
this problem is specific to Linux, I think. in Solaris and IRIX,
stating /var/mail is left to the shell (which calls /bin/mailx -e in
/etc/login or something). a simple ^C is thus enough to make the
login sequence continue. on Linux, you will instead kill login, and
be booted out.
Could I please ask that this bug is reopened?
As the previous comment states, /var/mail needs to be configured that
way to avoid mailbox corruption.
It is not unreasonable to want to have login stop stating for mail.
The "you have new mail" is so 10 years ago and entirely useless today,
while it however does screw up all my shells when NFS flakes
I checked the truss output on a Solaris 9 system. login does not
touch $MAIL in any way, except it initialise the variable. the main
things it does is:
* initialise environment (based on values in the binary and in
* lookup user info
* chdir $HOME
* check for nologin
* lookup value in /var/adm/lastlog
* check for .hushlogin
-- if not there, print the time I last logged in
* exec login shell
my login shell will then among other things run /bin/mail -e (as per
its startup files.)
Have people checked util-linux 2.12j ?
Maybe the discussion is about a problem of the past.
I just looked at it, and 2.12j indeed fixes this with
DO_STAT_MAIL, which is off by default.
Thanks to whoever fixed this.
(or course, as far as RH bugzilla is concerned, it would probably be
proper to re-open thish bug until this version is bundled as an RPM,
especially since it's not a WONTFIX anymore)