0

Trying to remove a user from one of our servers, but I seem to be thwarted at every turn...

SMC refuses to load the user list (failing with a NoClassDefFoundError in the listAll method of UserContent).

vipw just returns with "vipw: /etc/passwd file busy".

I'm the only user on the system at the moment (it's our backup SRSS box), and both of these fail even right after a reboot. I don't have console access at the moment either unfortunately (or I would try single user mode). Of course, even if init mode S worked and let me do this one task, it doesn't solve the root problem.

Ideas?

Brian Knoblauch
  • 2,196
  • 2
  • 32
  • 48
  • No clue where to go on the vipw part of the problem, and fixing SMC solved the immediate issue... So, retitling to something more appropriate for where we're at now... – Brian Knoblauch Mar 08 '10 at 12:44

2 Answers2

1

check with fuser /etc/passwd what process is using it and kill it. obviously make sure it's safe to kill that process.

rytis
  • 2,382
  • 1
  • 18
  • 13
  • Helpful. I had forgotten about the "fuser" command (apparently I learned something new that made that not fit in my head anymore)... fuser claims that nscd has it locked. Killed nscd and now fuser claims it's wide open, yet both vipw and smc are still failing. So, it didn't actually solve the main problem, but added another question: "Why is nscd tying up the file on this particular box?". – Brian Knoblauch Mar 05 '10 at 14:29
  • hmm been a while since i touched solaris (i guess last sol experience was with sol9, so i missed all the new beauty things in sol10)... i can only guess that nscd trying to cache user info (why though??). i presume other boxes do not manifest this behaviour? ah well at least i reminded you about the fuser, hopefully that didn't push smth else out! ;) – rytis Mar 05 '10 at 16:04
  • You're correct, the other Solaris boxes have no problem with either SMC or vipw. – Brian Knoblauch Mar 05 '10 at 16:13
  • vipw also looks at /etc/ptmp when checking /etc/passwd for availability. Clearing or removing that lock file should help. – pra Mar 08 '10 at 18:11
  • Yep, ptmp contains the passwd file! I wonder what might be setting locking via /etc/ptmp though? – Brian Knoblauch Mar 25 '10 at 18:18
1

Solution (actually, workaround) found (at least for SMC, still baffled by vipw problem) at: http://forums.sun.com/thread.jspa?messageID=10266935

rogerfujii says:

Sigh. They broke the classpath somewhere. This is not the correct fix, but will get you by if
 you need it to work (don't really understand what is supposed to get loaded where, so I stuck
 it at the end of the process):

 Edit /usr/sadm/lib/smc/bin/smc

 Add this line:

 L10NJARS="${L10NJARS} ${JARPATH}/../../VCommon.jar ${JARPATH}/../../usermgr/*.jar"

 just before the "for jar in ${L10NJARS}; do" line.

 (this is the smallest "fix", as it takes advantage of the shell expansion to deal with all the usermgr stuff).

 Save. You want to keep the original around and put it back when/if sun ever gets around to fixing this,
 just in case the fix doesn't include this file.
Brian Knoblauch
  • 2,196
  • 2
  • 32
  • 48