Re: mail command hangs with just one user (355 Views)
Reply
Regular Advisor
Paul Maglinger
Posts: 173
Registered: ‎05-11-2007
Message 1 of 5 (378 Views)
Accepted Solution

mail command hangs with just one user

Running HP-UX 11.31 on Itanium rx2660 box.  There is one user when they enter the "mail" command it just hangs until they break out of it.  All other users work fine.  I have tried cleaning the mail (they said it was okay to do so) by

# cat /dev/null > /var/mail/username

 

There is nothing in the mail queue.

 

I have tried Google-Fu but the results I'm getting concern things like the sendmail service not starting on bootup, etc. 

 

I'm not sure how else to explain through search other than it just hangs.

 

Anyone have suggestions on how to troubleshoot or correct this problem?

 

TIA,

 

Paul

Honored Contributor
Steven Schweda
Posts: 9,096
Registered: ‎02-23-2005
Message 2 of 5 (355 Views)

Re: mail command hangs with just one user

Regular Advisor
Paul Maglinger
Posts: 173
Registered: ‎05-11-2007
Message 3 of 5 (347 Views)

Re: mail command hangs with just one user

>> Anyone have suggestions on how to troubleshoot or correct this
>> problem?
 
  > I know nothing, but if your standards are low enough, ...
I'm willing to give it a shot...

>> There is one user when they enter the "mail" command it just hangs until >> they break out of it. > Which 'the "mail"' program is that, and is it the same one for the other (luckier) users? > type mail >which mail >(or whatever works with your (unspecified) shell) /usr/bin/mail

>> All other users work fine. >> I'd expect that to mean a difference between the file(s) and/or environment specific to that user, and those specific to another user. At what have you looked already? Just what I mentioned. Now that you brought it up, I'll see if there's anything in the .profile, etc. that stands out.

>> I have tried cleaning the mail (they said it was okay to do so) by >> # cat /dev/null > /var/mail/username > Less destructive and more informative might have been things like, say: > mv /var/mail/username /var/mail/username_ > cp -p /var/mail/username_ /var/mail/username > Thus not losing any useful info in /var/mail/username, and providing a new file for the "mail" program. (If a new, empty file is desired, that's also easy to do without losing the original.) >> [...] it just hangs [...] > I'd try using "trace", or "truss", or "tusc" (or whatever works on HP-UX) to look at the system calls when a lucky user and an unlucky user try to do the same thing. A program like "top" might tell you if the "mail" program is looping or stuck. > Perhaps some other program has the user's /var/mail/xxx file locked somehow. "fuser" and/or "lsof" might reveal that. (I haven't used a UNIX system for mail for decades, so I know nothing, but perhaps another instance (process) of "mail" run by the unlucky user could do this.) Both good suggestions. I'll take a look.
>> There is nothing in the mail queue. > I wouldn't expect that (outgoing mail?) to matter.
Just sayin'...

Thanks Steve
Regular Advisor
Paul Maglinger
Posts: 173
Registered: ‎05-11-2007
Message 4 of 5 (341 Views)

Re: mail command hangs with just one user

Thanks Steve. Found the issue in the .profile. The user had a line:
MAIL=/usr/spool/mail/$USER
The mail directory didn't exist. Everything is working fine now.
Acclaimed Contributor
Dennis Handly
Posts: 25,277
Registered: ‎03-06-2006
Message 5 of 5 (324 Views)

Re: mail command hangs with just one user

>There is one user when they enter the "mail" command

 

On HP-UX, nobody should use the obsolete mail command.  They instead should be using mailx(1).

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.