MacOS – Why doesn’t the Terminal show ‘last login’ message

macosterminal

Terminal.app on my mac used to show Last login: <date time> on ttys000 as the first line.
However, when I opened it this week, I noticed that it didn't show the message.
Is this normal, or did I do something wrong?

I tried rebooting mac, and tried 'repair disk permissions' in Disk Utility, but neither of them fixed the problem.
I found that ~/.hushlogin suppresses the message, but no such file was found when I tried ls -la ~.

I'm using OS X 10.8.5.

Edit:
I installed GPG Suite last weekend.
Does it have something to do with the problem?

Update:
I think this problem is systemwide, because it is reproduced in Guest account.
I suspect that the log file of last login may be corrupt.
Is this possible?
How can I check this?

Update 2:
I tried opening another window while running sudo opensnoop -ve -n login.
I found that login failed in opening some files in /var/log/asl/ and the 'errno values' were '24'.

Update 3:
I found that errno 24 meant 'too many open files', and tried reducing the log files by sudo aslmanager. This fixed the problem! I don't know why these log files had remained undeleted though.

Best Answer

login should display that message unless it is run with a '-q' option or the file '.hushlogin' exists.

It would be good to know the command line for login.

At the command prompt go ps ax | grep login and you should get a line for each open Terminal window that reads something like this :

login -pf <username> 

or

login -pfl <username> exec -la bash /bin/bash

Check that out and see what it says.

bash and it's profiles have nothing to do with displaying that message. The setting of the "Shell" preference also makes no difference as login is run regardless of how this is set.

If login is not being run with a -q option then something else is happening. If you try type -a login you should get nothing but login is /usr/bin/login. I'd also triple check that ~/.hushlogin does not exist.