LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 06-16-2005, 04:12 PM   #1
co_bofh
LQ Newbie
 
Registered: Mar 2005
Location: Longmont, Co
Distribution: OpenBSD, Solaris, Red Hat, Ubuntu, OS X, HP-UX, Tru64
Posts: 20

Rep: Reputation: 0
passwd hangs


Greetings,

I'm running a Red Hat Linux 3.2.3-52 on a 2.4.21-32.0.1 ELsmp kernel.

We have a couple of Red Hat systems that, when you try to change your password, just hangs. So far the admins here have rebooted the box and it's resolved the problem. I had them hold off last time while I checked in to it but they needed to get someone in to the system so they rebooted.

Now the problem isn't going away with a reboot.

The pam files are dated Jun 4 2004 with a couple of others with an older 2003 date.

The /etc/pam.d/passwd file:

#%PAM-1.0
auth required pam_stack.so service=system-auth
account required pam_stack.so service=system-auth
password required pam_stack.so service=system-auth
password required /lib/security/pam_cracklib.so

When I type in passwd, it just hangs:

Linux:[server]$ passwd
Changing password for user carls.


Anything you can think of to check?

Thanks for any help.

Carl
 
Old 06-17-2005, 09:15 AM   #2
zulfilee
Member
 
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
HI,
Can you run a strace command and see where exactly it hangs

Type

strace passwd

Instead of passwd

It will show you the system calls the command makes.
Just get some 5 lines from where the command hangs and post it.

Cheers
Z
 
Old 06-17-2005, 11:33 AM   #3
co_bofh
LQ Newbie
 
Registered: Mar 2005
Location: Longmont, Co
Distribution: OpenBSD, Solaris, Red Hat, Ubuntu, OS X, HP-UX, Tru64
Posts: 20

Original Poster
Rep: Reputation: 0
Ahh, that was what I was looking for. I'm a Sun admin as was looking for a Linux tool that worked like ptrace. Thanks.

Oh and the problem was /etc/.pwd.lock. I saw the permission denied errors in the strace output and removed the file which fixed the problem. Weird that a file dated Jun 25, 2004 would cause intermittant problems since passwd changes would occur with no problem most of the time, just that once in a while it'd hang.

Anyway, thanks again. Sticking strace in a prominant place.

Carl
 
Old 06-17-2005, 12:02 PM   #4
co_bofh
LQ Newbie
 
Registered: Mar 2005
Location: Longmont, Co
Distribution: OpenBSD, Solaris, Red Hat, Ubuntu, OS X, HP-UX, Tru64
Posts: 20

Original Poster
Rep: Reputation: 0
Of course the problem is, why would a suid'd passwd program be unable to write to /etc/.pwd.lock perms 600 ownership root:root?

Anybody?

Thanks again for the immediate fix.

Carl
 
Old 06-18-2005, 04:28 AM   #5
zulfilee
Member
 
Registered: Apr 2004
Location: India
Distribution: Redhat,Fedora
Posts: 430

Rep: Reputation: 39
Its not that the program was not able to write over it.
But the file was a lock and a lock has to be respected by any program till the lock is cleared by the command that created it.

Cheers
Z
 
Old 06-20-2005, 09:37 AM   #6
co_bofh
LQ Newbie
 
Registered: Mar 2005
Location: Longmont, Co
Distribution: OpenBSD, Solaris, Red Hat, Ubuntu, OS X, HP-UX, Tru64
Posts: 20

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by zulfilee
Its not that the program was not able to write over it.
But the file was a lock and a lock has to be respected by any program till the lock is cleared by the command that created it.

Cheers
Z
Ok, that's a good point that I hadn't thought of and makes sense. So someone started passwd and the session died leaving the lock file.

Question then. Since it had a date of almost a year ago, why would any further passwd attempts work? It seemed to be either intermittent or tied to how long the system was up since rebooting seemed to resolve the problem up until this last incident.

Time to "use the source, Luke".

Thanks for the info though. Good answer.

Carl
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
/etc/passwd XaViaR Linux - General 1 06-13-2005 10:12 AM
net driver causes system hangs (keyboard hangs) yjchen Linux - Networking 0 10-21-2004 10:12 PM
about passwd jnzhang Linux - General 7 07-08-2003 04:32 PM
/etc/passwd help debdas Linux - General 3 05-09-2003 01:28 PM
passwd Winter Linux - Security 2 05-01-2002 05:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:55 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration