Operating System - HP-UX
1829185 Members
3412 Online
109986 Solutions
New Discussion

useradd reports '/etc/passwd file busy -- try again'

 
GIS-CGISS
Occasional Contributor

useradd reports '/etc/passwd file busy -- try again'

i have verified that /etc/ptmp does not exist
is there anything that can be done to fix this other than a reboot and going to single user mode. i am running on os 10.20 on a model
9000/715
6 REPLIES 6
Steven E. Protter
Exalted Contributor

Re: useradd reports '/etc/passwd file busy -- try again'

ll /etc/passwd

fuser -cu /

See if there are any processes on the root fs. Check them by number as to what they are dong.

bdf /

If the root fs is too close to full or full this behavior can result.

If yo ucan find nothing, reboot the machine.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Chris Watkins_1
Respected Contributor

Re: useradd reports '/etc/passwd file busy -- try again'

fuser works at a "file" level too.
Try this instead:
fuser -fu /etc/passwd

My output follows... for instance:

# fuser -fu /etc/passwd
# /etc/passwd 1785o(root)
# ps -ef |grep 1785 |grep -v grep
# root 1785 1 0 Nov 16 ? 0:02 /usr/sbin/pwgrd


If you see something other than the pwgrd process,
find out what it is, as it may be your problem.




Not without 2 backups and an Ignite image!
Todd McDaniel_1
Honored Contributor

Re: useradd reports '/etc/passwd file busy -- try again'

You might also look for this:

When you access the password file, the /etc/.pwd.lock file is created, so that other processes do not acccess the file. It is possible the file was not deleted the last time /etc/passwd was accessed.

Maybe that is what is showing it as busy.


Also, check for any vipw that is zombied.
Unix, the other white meat.
James Lynch
Valued Contributor

Re: useradd reports '/etc/passwd file busy -- try again'

Another thing to check is to see if there are any vipw processes running. The vipw command is what creates the the lockfile. It's possible that there is still one running.

JL
Wild turkey surprise? I love wild turkey surprise!
Jack Werner
Frequent Advisor

Re: useradd reports '/etc/passwd file busy -- try again'

I know that we still do some administration the "old fashioned" way; but using vi to modify /etc/passwd usually doesn't present this kind of problem. We have a procedure that is used to assign a new user a unique UID Number that is all our Admin needs to manually add the new user to /etc/passwd. If using, NIS make sure you update the /etc/passwd file on the NIS Server.
i'm retired
Dietmar Konermann
Honored Contributor

Re: useradd reports '/etc/passwd file busy -- try again'

The useradd(1M) command uses the lckpwdf(3C) library function to ensure exclusive access to /etc/passwd.

This is accomplished by creating and locking the file /etc/.pwd.lock using lockf(2). Check for that file and if its busy.

# fuser /etc/.pwd.lock

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)