DaemonForums  

Go Back   DaemonForums > NetBSD > NetBSD General

NetBSD General Other questions regarding NetBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 7th October 2013
pawaan pawaan is offline
Port Guard
 
Join Date: Jan 2013
Posts: 36
Thanked 0 Times in 0 Posts
Default pwd_mkdb exited with status 1

I 'm running NetBSD 6.1.2 (GENERIC) i386 & I have an issue with pwd_mkdb the root of which I don't know.

I can't create users :
#useradd -m -G wheel himmel
Code:
useradd: pwd_mkdb exited with status 1
useradd: Can't add user `himmel': pw_mkdb failed

and pkg_add can't either :
Code:
useradd: pwd_mkdb exited with status 1
useradd: Can't add user `clamav': pw_mkdb failed
strange problem :
There used to be a user 'mimir' which I deleted.now what happens is
Code:
#userdel mimir
userdel: Can't modify user `mimir': must be a local user
&
Code:
# useradd -m -G wheel mimir
useradd: Can't add user `mimir': `mimir' is already a user
root shell is ksh not sh.

Thanks for help.

Regards.
Reply With Quote
  #2   (View Single Post)  
Old 7th October 2013
jmccue jmccue is offline
Real Name: John McCue
New User
 
Join Date: Aug 2012
Location: here
Posts: 3
Thanked 0 Times in 0 Posts
Default

Works fine here, I would use vipw(8) and correct entries there then edit /etc/groups and fix if need be. once fixed try again.
Reply With Quote
  #3   (View Single Post)  
Old 7th October 2013
pawaan pawaan is offline
Port Guard
 
Join Date: Jan 2013
Posts: 36
Thanked 0 Times in 0 Posts
Default

vipw has clean entries.just deleted two users from wheel in /etc/group which did't solve the problem.
Reply With Quote
  #4   (View Single Post)  
Old 7th October 2013
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,141
Thanked 182 Times in 149 Posts
Default

It looks like the compiled password databases are corrupted. You could remove them and then rebuild them. See pwd_mkdb(8)

Code:
     /etc/pwd.db                       The insecure password database file.
     /etc/pwd.db.tmp                   A temporary file.
     /etc/spwd.db                      The secure password database file.
     /etc/spwd.db.tmp                  A temporary file.
BTW adding a new user probably is the easiest way to rebuild those databases.
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #5   (View Single Post)  
Old 8th October 2013
pawaan pawaan is offline
Port Guard
 
Join Date: Jan 2013
Posts: 36
Thanked 0 Times in 0 Posts
Default

the problem is I can't add a user:
Code:
useradd: pwd_mkdb exited with status 1
useradd: Can't add user `feefo': pw_mkdb failed
Reply With Quote
  #6   (View Single Post)  
Old 9th October 2013
s0xxx's Avatar
s0xxx s0xxx is offline
Package Pilot
 
Join Date: May 2008
Posts: 194
Thanked 47 Times in 22 Posts
Default

What is the output of:
Code:
ls -l /etc/ptmp
Have you tried reconstructing the database as suggested by others? Try running:
Code:
pwd_mkdb /etc/master.passwd
If there is something wrong with it, or the file is missing, check in /var/backups/ for a backup of it.
__________________
The best way to learn UNIX is to play with it, and the harder you play, the more you learn.
If you play hard enough, you'll break something for sure, and having to fix a badly broken system is arguably the fastest way of all to learn. -Michael Lucas, AbsoluteBSD
Reply With Quote
  #7   (View Single Post)  
Old 9th October 2013
pawaan pawaan is offline
Port Guard
 
Join Date: Jan 2013
Posts: 36
Thanked 0 Times in 0 Posts
Default

thanks for providing help
Code:
# ls -l /etc/ptmp
ls: /etc/ptmp: No such file or directory
Code:
# pwd_mkdb /etc/master.passwd
pwd_mkdb: Cannot open `/etc/pwd.db.tmp': File exists
Reply With Quote
  #8   (View Single Post)  
Old 9th October 2013
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 3,141
Thanked 182 Times in 149 Posts
Default

In http://www.daemonforums.org/showthre...8112#post48505 I suggested to remove all these files and then rebuild them
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #9   (View Single Post)  
Old 9th October 2013
pawaan pawaan is offline
Port Guard
 
Join Date: Jan 2013
Posts: 36
Thanked 0 Times in 0 Posts
Default

seems like within a vicious circle
I remove those then fail to rebuild
pkg_create fails as it can't look up current user (which is root ) in the passwd file
Reply With Quote
Reply

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Status of Current amd64 shep OpenBSD General 3 24th August 2010 02:14 PM
e-mail notification status? jggimi Feedback and Suggestions 3 17th September 2009 04:49 AM
dwm status bar won't display apm output asemisldkfj General software and network 6 16th August 2009 11:07 PM
What is the status of KDE4? wubrgamer General software and network 10 24th September 2008 03:58 AM
Status of Xen on OpenBSD Oko OpenBSD General 2 19th June 2008 09:02 PM


All times are GMT. The time now is 07:23 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick