Masato Taruishi
taru****@sourc*****
2004年 6月 15日 (火) 13:36:55 JST
=================================================================== RCS file: ultrapossum/module/server/00server,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- ultrapossum/module/server/00server 2004/06/01 08:00:50 1.32 +++ ultrapossum/module/server/00server 2004/06/15 04:36:55 1.33 @@ -172,7 +172,7 @@ fi ULTRAPOSSUM_APPS=`find $APPSDIR -type f -maxdepth 1 | grep -v tmp | xargs -n1 basename 2> /dev/null || true` -ULTRAPOSSUM_INDEX=`grep index $ULTRAPOSSUM_MASTER_SLAPD_CONF 2> /dev/null || true` +ULTRAPOSSUM_INDEX=`egrep '^index' $ULTRAPOSSUM_MASTER_SLAPD_CONF 2> /dev/null | tr '\n' ' '` ULTRAPOSSUM_SLAPD_CONFIN=`ultrapossum_getconf ULTRAPOSSUM_SLAPD_CONFIN $TEMPLATEDIR/slapd-$SLAPD_BACKEND_DB_TYPE.conf.in` =================================================================== RCS file: ultrapossum/module/server/update-server,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- ultrapossum/module/server/update-server 2004/06/14 09:17:53 1.36 +++ ultrapossum/module/server/update-server 2004/06/15 04:36:55 1.37 @@ -29,7 +29,7 @@ trap "rm -f $tmp; eval `ultrapossum-config term`" 0 configure_slapd() { - echo -n "Configuring OpenLDAP for $TYPE... " 1>&2 + progress "Configuring OpenLDAP for $TYPE... " install -d $CONFDIR @@ -87,7 +87,7 @@ chmod 600 $APPSLDIF $MODULEDIR/server/apps ldif > $APPSLDIF - echo "done" 1>&2 + progress "Configuring OpenLDAP for $TYPE... done" if test -f "$ULTRAPOSSUM_INIT_LDIF_IN"; then echo -n "Configuring initial LDIF... " 1>&2 @@ -106,14 +106,26 @@ if ! test -d "$DIRECTORY"; then $MODULEDIR/server/createdb.sh else - index_old=`getvalue $DIRECTORY/ultrapossum-environ SLAPD_BACKEND_DB_TYPE` + index_old=`getvalue $DIRECTORY/ultrapossum-environ ULTRAPOSSUM_INDEX` if test "x$ULTRAPOSSUM_INDEX" != "x$index_old"; then + echo "index; $ULTRAPOSSUM_INDEX, old: $index_old" 1>&2 if test "`$MODULEDIR/server/startup status`" = "running"; then echo "W: index configuration is changed while server is running" 1>&2 else - echo -n "Indexing database... " 1>&2 - slapindex -f $SLAPDMASTERCONF -b $SUFFIX - echo "done" 1>&2 + progress "Indexing database... " + ( slapindex -v -f $SLAPDMASTERCONF -b $SUFFIX || echo "ERROR" ) | + egrep '00$|ERROR$' | while read line + do + if test "x$line" = "xERROR"; then + exit 1 + fi + v=`echo $line | sed 's/.*id=0*\(.*\)/\1/'` + progress "Indexing database... $v" + done || exit 1 + touch $DIRECTORY/ultrapossum-environ + chmod 600 $DIRECTORY/ultrapossum-environ + getconfig > $DIRECTORY/ultrapossum-environ + progress "Indexing database... done" fi fi fi