Bug 138585 - /bin/login should have an override for _PATH_MAILDIR (used to build $MAIL)
/bin/login should have an override for _PATH_MAILDIR (used to build $MAIL)
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: util-linux (Show other bugs)
3.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Elliot Lee
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-11-09 20:03 EST by Marc MERLIN
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2004-12-03 13:12:11 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Marc MERLIN 2004-11-09 20:03:07 EST
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
Comment 1 Marc MERLIN 2004-11-19 16:05:37 EST
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)
Comment 2 Elliot Lee 2004-12-03 13:12:11 EST
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.
Comment 3 Kjetil T. Homme 2004-12-04 08:05:22 EST
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.
Comment 4 Marc MERLIN 2004-12-08 13:15:34 EST
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
Comment 5 Kjetil T. Homme 2004-12-09 13:03:12 EST
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
/etc/default/login)
* 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.)
Comment 6 aeb 2004-12-09 14:24:22 EST
Have people checked util-linux 2.12j ?
Maybe the discussion is about a problem of the past.
Comment 7 Marc MERLIN 2004-12-10 02:39:56 EST
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.
Comment 8 Marc MERLIN 2004-12-10 02:41:19 EST
(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)

Note You need to log in before you can comment on or make changes to this bug.