Operating System - HP-UX
1832344 Members
2448 Online
110041 Solutions
New Discussion

Can't create new user via /usr/sbin/useradd

 
Brad Marks
Super Advisor

Can't create new user via /usr/sbin/useradd

Instaed of being prompted for new passwd, I'm told that "/etc/passwd file busy -- try again"

At first I fuser'd /etc/passwd and found that pwgrd had it open. I tried stopping pwgrd but the error persists although no one has /etc/passwd open.

Any ideas?
Thanks in advance,
Brad
It's not impossible -- it'll just cost more...
8 REPLIES 8
RAC_1
Honored Contributor

Re: Can't create new user via /usr/sbin/useradd

Can you do vipw??
What does fuser -u /etc/passwd
and
lsof /etc/passwd say??
There is no substitute to HARDWORK
A. Clay Stephenson
Acclaimed Contributor

Re: Can't create new user via /usr/sbin/useradd

See if the lock file /etc/ptmp is present; if so, remove it.
If it ain't broke, I can fix that.
Brad Marks
Super Advisor

Re: Can't create new user via /usr/sbin/useradd

vipw results in:
lckpwdf: No such file or directory
vipw: Cannot obtain lock for /etc/.pwd.lock

fuser -u /etc/passwd:
/etc/passwd: 23100o(root) <-- 23100 is pwgrd

ll /etc/passwd:
-rw-rw-rw- 1 root sys 55953 Aug 15 14:12 /etc/passwd
It's not impossible -- it'll just cost more...
Uday_S_Ankolekar
Honored Contributor

Re: Can't create new user via /usr/sbin/useradd

When passwd file does modification it creates a file called /etc/ptmp to lock the file. Check if you have that file in there

-USA..
Good Luck..
Brad Marks
Super Advisor

Re: Can't create new user via /usr/sbin/useradd

/etc/ptmp does not exist.
It's not impossible -- it'll just cost more...
Raj D.
Honored Contributor

Re: Can't create new user via /usr/sbin/useradd

Hi Brad ,

It seems that /etc/passwd is busy , either vipw is in progress or yppasswd , and boh uses lock file in /etc/ptmp .

Check for this file. The /etc/ptmp file will persist if /etc/passwd file is being updated.

pls update with more info..

Cheers,
Raj
" If u think u can , If u think u cannot , - You are always Right . "
A. Clay Stephenson
Acclaimed Contributor

Re: Can't create new user via /usr/sbin/useradd

See if the file /etc/.pwd.lock exists and if so remove it. You should also do a bdf to make sure there is available space in the filesystems -- especially /, /var, and /tmp.


If it ain't broke, I can fix that.
Brad Marks
Super Advisor

Re: Can't create new user via /usr/sbin/useradd

I've never used vipw before, but the error message it generated got me thinking that maybe /etc/.pwd.lock did not exist and, because of this vipw wouldn't work.

I could not find .pwd.lock anywhere on the system, so I touch'd /etc/.pwd.lock, and am now able to run vipw and, I presume, useradd.

Thanks for getting me pointed in the right direction.

Regards,
Brad
It's not impossible -- it'll just cost more...