Bug 138585 - /bin/login should have an override for _PATH_MAILDIR (used to build $MAIL)
Summary: /bin/login should have an override for _PATH_MAILDIR (used to build $MAIL)
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: util-linux
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Elliot Lee
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-11-10 01:03 UTC by Marc MERLIN
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-12-03 18:12:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Marc MERLIN 2004-11-10 01:03:07 UTC
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 21:05:37 UTC
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 18:12:11 UTC
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 13:05:22 UTC
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 18:15:34 UTC
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 18:03:12 UTC
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 19:24:22 UTC
Have people checked util-linux 2.12j ?
Maybe the discussion is about a problem of the past.


Comment 7 Marc MERLIN 2004-12-10 07:39:56 UTC
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 07:41:19 UTC
(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.