You are not logged in.

#1 2005-05-18 17:28:42

z4ziggy
Member
From: Israel
Registered: 2004-03-29
Posts: 573
Website

useradd on rc.sysinit error [solved]

i am trying to execute "useradd" on rc.sysinit to allow dynamic user creation on startup for the Archie Live project and im getting "unable to lock password file". trying to execute the same command after login works fine. i checked for no /etc/passwd.lck nor /var/lock/passwd. im guessing its because the init process hasnt finished yet, but i might be wrong. any ideas how to fix/overcome this?

tnx in advance

Offline

#2 2005-05-18 20:48:11

i3839
Member
Registered: 2004-02-04
Posts: 1,185

Re: useradd on rc.sysinit error [solved]

Run it with strace to see what file it tries to use (`strace -o logfile useradd`).

Offline

#3 2005-05-18 22:38:12

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: useradd on rc.sysinit error [solved]

check and see if its before the root filesystem is remounted rewrite.

so you'd need to do it after mounting local filesystems (or at least in my hackish rc.sysinit)

Offline

#4 2005-05-18 23:40:18

z4ziggy
Member
From: Israel
Registered: 2004-03-29
Posts: 573
Website

Re: useradd on rc.sysinit error [solved]

well, the problem was /etc/.pwd.lock, im guessing since it was used by the init process. im deleting it before the useradd, and all works well.
tnx i3839 for the tip (as always...) wink

Offline

#5 2006-02-28 22:12:08

_Gandalf_
Member
Registered: 2006-01-12
Posts: 735

Re: useradd on rc.sysinit error [solved]

z4ziggy said that deleting /etc/.pwd.lock before running useradd solved the problem, so rm -f /etc/.pwd.lock before the command wink

Offline

#6 2006-03-01 15:11:55

_Gandalf_
Member
Registered: 2006-01-12
Posts: 735

Re: useradd on rc.sysinit error [solved]

oh well, make sure it is mounted rw then, try mount -o remount,rw / before removing the file

Offline

Board footer

Powered by FluxBB