Shell performance issue

I’m having a shell performance issue, APOK vs TOFU… when I login to TOFU I get the welcome message etc and almost immediately get a prompt: [tofu]$
yet when I login to APOK it hangs for_ever after the welcome until I finally get: user@apok:~$

Anyone know what may be causing this and how to remedy the situation? Putting me on edge a bit :slight_smile:



Do you read mail for the user on apok? My guess is that you have a crontab which is sending tons of mail to the user (which you’d notice if you used that user for mail), and since MAILCHECK is set in /etc/profile,

Setting MAILCHECK to a different interval should fix it, but won’t… if this is the problem, you should do the following:

  1. Clear out the mail for that user; if you don’t receive any regular mail at your domain at that user, you can remove everything in ~/Maildir/cur/ and ~/Maildir/new/. Probably doing "rm Maildir/cur/" won’t work because there will be so many files - do:
    for f in ~/Maildir/new/
    ; do rm $f ; done
    (same for ~/Maildir/cur/ if there’s anything in there).

  2. Prevent cron from sending mails by either sending stderr / stdout from your cron jobs to a file (or, more likely, to /dev/null), or by setting MAILTO="" in the crontab.

An example:

[code]* * * * * /my/cron/job >/dev/null 2>&1
(sends stdout and stderr to /dev/null)

          • /my/cron/job >/dev/null 2>$HOME/cron_errs
            (I think should send stdout to /dev/null and stderr to a logfile)

Simply setting MAILTO="" will work for most people.

Nail on the head, you’re truly a PooBah

Thanks a ton!


Also, setting $MAILCHECK (in your .bash_profile) to an empty string or a negative integer may also fix problems like this, though I’ve had mixed success with this in actual practice. We might stop making this check the default (though sometimes it’s good when it brings other problems to light, such as in this case).