Date: Fri, 6 Dec 2002 18:10:20 -0500 From: Don Bowman <don@sandvine.com> To: "'freebsd-stable@freebsd.org'" <freebsd-stable@freebsd.org> Subject: pw useradd not atomic? Message-ID: <FE045D4D9F7AED4CBFF1B3B813C8533701023135@mail.sandvine.com>
next in thread | raw e-mail | index | archive | help
In a test-lab environment, I'm forging users on a machine
based on their home directory name/permissions:
for i in /phaedrus/home/*
do
if [ -d $i ]
then
id=$(ls -lnd $i | awk '{print $3}')
gid=$(ls -lnd $i | awk '{print $4}')
uid=$(basename $i)
id $id 2>/dev/null 1>/dev/null
if [ $? -eq 1 ]
then
pw useradd $uid -u $id -s /bin/bash
ln -s $i /home
fi
fi
done
This is done the first time the machine is imaged. I don't
want to run NIS or any other directory service. I use ssh for
access with just dsa keys so I'm not worried about actual
passwords for these accounts, just to make them exist.
The groups file starts out normal:
wheel:*:0:root
daemon:*:1:daemon
kmem:*:2:root
...
Sometimes after this script been run I end up with only the
last few lines of the groups file.
Is 'pw' not atomic somehow? The lines that are there seem
complete, i'm just missing the first 100 lines or so. Its
not always the same amount missing.
--don (don@sandvine.com www.sandvine.com)
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FE045D4D9F7AED4CBFF1B3B813C8533701023135>
