Hi,
I was trying to make napp-it survive a reboot and found that updimg kept on
recursively adding directories if they are entered in the .backup file.
# cp updated files/symlinks to mounted img
update_file() {
for f in $FILES ; do
[ -h $f ] && {
# uncomment below to see symlink list
echo " SYMLINK: $f"
find $f | cpio -pmadv $MNT > /dev/null 2>&1
} || {
[ ! -h $f -o -d $f ] && {
# uncomment below to see file list
echo " FILE/DIR: $f"
cp -pR $f $MNT$f > /dev/null 2>&1
}
}
done
}
That cp statement will take a directory if it already exists and create another
copy under it.
So if you add /var/apache2/2.2/cgi-bin/napp-it/* to the .backup file each time
you update the image another copy of directories under napp-it is created under
the existing one
FILE/DIR: /var/apache2/2.2/cgi-bin/napp-it/sunos
+ set -x
+ cp -pR /var/apache2/2.2/cgi-bin/napp-it/sunos
/mnt/upd/var/apache2/2.2/cgi-bin/napp-it/sunos
Maybe something like this might be better (unless I'm doing something wrong
with the .backup file?).
# cp updated files/symlinks to mounted img
update_file() {
for f in $FILES ; do
[ -h $f ] && {
# uncomment below to see symlink list
echo " SYMLINK: $f"
find $f | cpio -pmadv $MNT > /dev/null 2>&1
} || {
[ ! -h $f -o -d $f ] && {
# uncomment below to see file list
echo " FILE/DIR: $f"
if [ -d $f ];then
cp -pR $f $MNT`dirname $f` > /dev/null 2>&1
else
cp -pR $f $MNT$f > /dev/null 2>&1
fi
}
}
done
}
Also .. once the above issue has filled up root the script fails to write the
/etc/svc/repository.db file and then completes the image (without it). This
causes fun when the server is rebooted if you missed it. Might be worth adding
a check for the exit status of cp for that copy and flagging a problem?
--Ian
--
This message posted from opensolaris.org
_______________________________________________
distribution-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/distribution-discuss