1831479 Members
3422 Online
110025 Solutions
New Discussion

Add user or group failed

 
SOLVED
Go to solution
Steve Yang_2
Advisor

Add user or group failed

When I tried to add users and groups to my HP-UX11.00, I found errors as follows:

add the user "fgsd". There was an unknown error in
"/usr/sam/lbin/useradd.sam". The output from this command was:
/etc/passwd file busy -- try again
I only have 2 user license.

Any ideas?

Thanks in advance
steve_yxf
15 REPLIES 15
Ceesjan van Hattum
Esteemed Contributor

Re: Add user or group failed

Type: fuser /etc/passwd
This will give you what or who claims the file by username or procesnumber.

Second try:
Edit /etc/passwd with vi and try to save the file.. can you?
Add name to /etc/group and create it's homedirectory.

Any success on this?

Ceesjan
James R. Ferguson
Acclaimed Contributor

Re: Add user or group failed

Hi Steve:

First verify that no other process is attempting to modify the password file. You can do a simple check with 'fuser' (or certainly with 'lsof'):

# fuser -f /etc/passwd

If no other entity appears to be using the /etc/passwd file, there may have been a previous operation that aborted leaving the lock file '/etc/ptmp' present.

If no processes are using the passwd file an 'etc/ptmp' is present, remove '/etc/ptmp'. This should repair your inability to perform maintenance.

Regards!

...JRF...
harry d brown jr
Honored Contributor

Re: Add user or group failed

Steve,

If I'm not mistaken you can upgrade your user license to unlimited for free.

http://www.software.hp.com/cgi-bin/swdepot_parser.cgi/cgi/displayProductInfo.pl?productNumber=UNLIMUSERLIC

live free or die
harry
Live Free or Die
James R. Ferguson
Acclaimed Contributor

Re: Add user or group failed

Hi:

The two-user license misleading. The console counts as one user when logged into; a serial port counts one user for every port with a login; but logins via a network (LAN), regardless of number, count only as *one* user.

Regards!

...JRF...
Steve Yang_2
Advisor

Re: Add user or group failed

I used fuser -ku /etc/passwd

to kill the process using the passwd file.

But problem still exists. There is no ptmp file.

I can edit the group file , but did not try the passwd yet.

How do I install the unlimited license anyway?

Thank you all!
steve_yxf
harry d brown jr
Honored Contributor

Re: Add user or group failed

download the patch/depot file from the link I provided before and use swinstall to install it.

live free or die
harry
Live Free or Die
Steve Yang_2
Advisor

Re: Add user or group failed

I installed the license but still can not add a group or user.

What can I do next?

Thanks in advance.
steve_yxf
Steve Yang_2
Advisor

Re: Add user or group failed

Here's status of passwd file

# fuser -f /etc/passwd
/etc/passwd: 920o

Even I killed the process, I still can not add users.

Any idea?

Thanks.
steve_yxf
Steve Yang_2
Advisor

Re: Add user or group failed

Here's status of passwd file

# fuser -f /etc/passwd
/etc/passwd: 920o

Even I killed the process, I still can not add users.

There is a process here using the pw file:

root 920 1 0 22:58:49 ? 0:00 /usr/sbin/pwgrd

Any idea?

Thanks.
steve_yxf
harry d brown jr
Honored Contributor

Re: Add user or group failed


Steve,

Have you tried shutting down and rebooting the server?

live free or die
harry
Live Free or Die
harry d brown jr
Honored Contributor

Re: Add user or group failed

Have you looked at this thread?

http://bizforums.itrc.hp.com/cm/QuestionAnswer/0,,0x67998cc5e03fd6118fff0090279cd0f9,00.html


live free or die
harry
Live Free or Die
doug hosking
Esteemed Contributor

Re: Add user or group failed

There are actually several reasons why this
can happen. I think James Ferguson was on
the right track with his /etc/ptmp comments,
but it turns out there are several ways to lock
the passwd file. It would help to know
whether you are running NIS, NIS+, trusted
mode, etc. That would let us more quickly
figure out which direction to look in.

The lckpwdf() man page states that the file
/etc/.pwd.lock is also used for locking
the password file, and useradd source showscalls to this function. Do you have a file
called /etc/.pwd.lock?

lckpwdf(3C) lckpwdf(3C)

NAME
lckpwdf(), ulckpwdf() - control access to /etc/passwd file

SYNOPSIS
#include

int lckpwdf (void)

int ulckpwdf (void)

DESCRIPTION
The lckpwdf() and ulckpwdf() routines are used to coordinate
modification access to the password file /etc/passwd and to the secure
password entries. The lock file used by these two routines is
/etc/.pwd.lock. A process first calls lckpwdf() to gain exclusive
access rights for password modification. When modifications are
complete, ulckpwdf() is called to release the lock on /etc/.pwd.lock.
This mechanism prevents simultaneous modification of password files or
entries.
Steve Yang_2
Advisor

Re: Add user or group failed

I have shutdown and reboot the system, but problem is still there.

There is no /etc/.pwd.lock file or /etc/ptmp file.

I am not using NIS or NIS+ either.

What else info would be helpful to solve this?

And Harry, I have read the thread you gave. But so far I am still having the problem.

Thank you all for your reply!

steve_yxf
James R. Ferguson
Acclaimed Contributor
Solution

Re: Add user or group failed

Hi (again) Steve:

You indicated that '/etc/.pwd.lock' isn't present on your system. It needs to be there. Do this to create it and then retry the user addition:

# touch /etc/.pwd.lock
# chmod 400 /etc/.pwd.lock
# chown root:sys /etc/.pwd.lock

Regards!

...JRF...


Steve Yang_2
Advisor

Re: Add user or group failed

Thank you James! I solved the problem.

But why was that happening? How come the .passwd.lock file was not there?

Thannk you guys all!
steve_yxf