diff options
author | Noriko Hosoi <nhosoi@redhat.com> | 2005-10-04 17:03:47 +0000 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2005-10-04 17:03:47 +0000 |
commit | af281db655ec1badaa28b991724e4084a809375f (patch) | |
tree | d77ac43c9163a430b0f5d8597f2351a5ca68f602 | |
parent | 37539f4e15056a7ee29d2a34eb41da2a97839d59 (diff) | |
download | ds-af281db655ec1badaa28b991724e4084a809375f.tar.gz ds-af281db655ec1badaa28b991724e4084a809375f.tar.xz ds-af281db655ec1badaa28b991724e4084a809375f.zip |
[167982] Service Pack framework
Ported the patch making code from Directory71RtmBranch to the trunk.
-rw-r--r-- | ldap/cm/Makefile | 7 | ||||
-rw-r--r-- | ldap/cm/fedora-patch.inf | 2 | ||||
-rwxr-xr-x | ldap/cm/newinst/setup | 77 | ||||
-rw-r--r-- | ldap/cm/redhat-patch.inf | 3 |
4 files changed, 75 insertions, 14 deletions
diff --git a/ldap/cm/Makefile b/ldap/cm/Makefile index 02256a76..70bb9f55 100644 --- a/ldap/cm/Makefile +++ b/ldap/cm/Makefile @@ -749,15 +749,18 @@ endif # BUILD_RPM ifdef BUILD_PATCH mkdir -p $(PATCHINSTDIR)/$(SLAPDSP) + cp $(INSTDIR)/setup $(PATCHINSTDIR)/dssetup + cp $(INSTDIR)/unzip_wrapper.pl $(PATCHINSTDIR) cp $(INSTDIR)/LICENSE.txt $(PATCHINSTDIR) cp $(INSTDIR)/README.txt $(PATCHINSTDIR) + cp $(BUILD_ROOT)/ldap/cm/newinst/setup.patch $(PATCHINSTDIR)/setup # prepare the main inf file: setup.inf pointing inf file $(SLAPDS)/$(SLAPD).inf sed -e "s/Components.*=/Components = $(SLAPDSP)/" $(INSTDIR)/setup.inf > $(PATCHINSTDIR)/setup.inf echo "" >> $(PATCHINSTDIR)/setup.inf echo "[$(SLAPDSP)]" >> $(PATCHINSTDIR)/setup.inf echo "ComponentInfoFile = $(SLAPDSP)/$(SLAPDSP).inf" >> $(PATCHINSTDIR)/setup.inf # create a zip file based upon the $(PATCHINF) file - cd $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR); zip -r $(PATCHINSTDIR)/$(SLAPDSP)/ns$(SLAPDSP).zip `egrep file: $(PATCHINF) | awk -F: '{print $$3}'` + cd $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR); zip -r $(PATCHINSTDIR)/$(SLAPDSP)/ns$(SLAPDSP).zip `egrep "^file:" $(PATCHINF) | awk -F: '{print $$3}'` # put ns-config and needed libs in the $(PATCHINSTDIR)/$(SLAPDSP) directory $(INSTALL) -m 755 $(RELDIR_32)/bin/slapd/admin/bin/ns-config $(PATCHINSTDIR)/$(SLAPDSP) -@for file in $(PACKAGE_SETUP_LIBS_32) ; \ @@ -767,7 +770,7 @@ ifdef BUILD_PATCH done # create patch inf file: $(SLAPD).inf cp $(OBJDIR)/slapd-patch.inf $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf - cd $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR); ls `egrep file: $(PATCHINF) | egrep -v "setup/setup" | awk -F: '{print $$3}'` > $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp + cd $(ABSRELDIR)/slapd/$(NS_BUILD_FLAVOR); ls `egrep "^file:" $(PATCHINF) | egrep -v "setup/setup" | awk -F: '{print $$3}'` > $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp echo `cat $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp` | sed -e "s/ /,/g" > $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp2 echo "BackupFiles="`cat $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp2`>> $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf rm -f $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp $(PATCHINSTDIR)/$(SLAPDSP)/$(SLAPDSP).inf.tmp2 diff --git a/ldap/cm/fedora-patch.inf b/ldap/cm/fedora-patch.inf index be5c87a6..9cc6e2d8 100644 --- a/ldap/cm/fedora-patch.inf +++ b/ldap/cm/fedora-patch.inf @@ -43,5 +43,5 @@ base: /share/dev4/fedora-ds/fds71/ships/20050526.1 file: 000001: README.txt -file: 000002: COPYRIGHT.txt +file: 000002: lib/libback-ldbm.* diff --git a/ldap/cm/newinst/setup b/ldap/cm/newinst/setup index 3d7819ed..f71a6fdb 100755 --- a/ldap/cm/newinst/setup +++ b/ldap/cm/newinst/setup @@ -130,6 +130,13 @@ getFQDN() { echo $maxhost } +getValFromAdminConf() { + cattr=$1 + cfile=$2 + rval=`grep -i $cattr $sroot/admin-serv/config/$cfile | awk '{print $2}'` + echo $rval +} + logfile=`doMktmp log` myargs= silent= @@ -188,6 +195,61 @@ if ! [ $silent ]; then askYN "Continue?" fi +# check whether it is an in-place installation +if [ -f $sroot/admin-serv/config/adm.conf ]; then + dsinst=`getValFromAdminConf "ldapStart:" "adm.conf" | awk -F/ '{print $1}'` + if [ -f $sroot/$dsinst/config/dse.ldif ]; then + # it is an in=place installation + ldaphost=`getValFromAdminConf "ldapHost:" "adm.conf"` + ldapport=`getValFromAdminConf "ldapPort:" "adm.conf"` + adminport=`getValFromAdminConf "\<port:" "adm.conf"` + siepid=`getValFromAdminConf "siepid:" "adm.conf"` + sysuser=`getValFromAdminConf "nsSuiteSpotUser:" "local.conf"` + suitespotuser=`ls -l $sroot/$dsinst/config/dse.ldif | awk '{print $3}'` + suitespotgroup=`ls -l $sroot/$dsinst/config/dse.ldif | awk '{print $4}'` + admindomain=`echo $ldaphost | awk -F. '{print $5 ? $2 "." $3 "." $4 "." $5: $4 ? $2 "." $3 "." $4 : $3 ? $2 "." $3 : $2 ? $2 : ""}'` + if [ "$admindomain" = "" ]; then + admindomain=`domainname` + fi + + echo "In order to reconfigure your installation, the Configuration Directory" + echo "Administrator password is required. Here is your current information:" + echo "" + echo "Configuration Directory: ldap://$ldaphost:$ldapport/o=NetscapeRoot" + echo "Configuration Administrator ID: $siepid" + echo "" + echo "At the prompt, please enter the password for the Configuration Administrator." + echo "" + echo "administrator ID: $siepid" + siepasswd="" + while [ "$siepasswd" = "" ]; do + printf "Password: " + read siepasswd + done + + inffile=$sroot/setup/myinstall.inf + echo "[General]" > $inffile + echo "FullMachineName= $ldaphost" >> $inffile + echo "SuiteSpotUserID= $suitespotuser" >> $inffile + echo "SuitespotGroup= $suitespotgroup" >> $inffile + echo "ServerRoot= $sroot" >> $inffile + echo "ConfigDirectoryLdapURL= ldap://$ldaphost:$ldapport/o=NetscapeRoot" >> $inffile + echo "ConfigDirectoryAdminID= $siepid" >> $inffile + echo "AdminDomain= $admindomain" >> $inffile + echo "ConfigDirectoryAdminPwd= $siepasswd" >> $inffile + echo "" >> $inffile + echo "[admin]" >> $inffile + echo "ServerAdminID= $siepid" >> $inffile + echo "ServerAdminPwd= $siepasswd" >> $inffile + echo "SysUser= $sysuser" >> $inffile + echo "Port= $adminport" >> $inffile + echo "ServerIpAddress=" >> $inffile + + # set silent mode + silent=1 + fi +fi + # dsktune if ! [ $silent ]; then bin/slapd/server/dsktune | tee -a $logfile @@ -251,13 +313,10 @@ if ! [ $silent ]; then # check if ds instance directory exists or not # if it does, run ns-config with the reconfigure option doreconfig="" - for x in `ls -d slapd-*` - do - if [ -d $x ]; then - doreconfig="-r" - break - fi - done + ls -d slapd-* > /dev/null 2>&1 + if [ $? -eq 0 ]; then + doreconfig="-r" + fi # first, run ds cd bin/slapd/admin/bin @@ -266,7 +325,7 @@ if ! [ $silent ]; then # next, run admin cd bin/admin - ./ns-config -f $inffile -l $logfile -m $installmode || doExit + ./ns-config -f $inffile -l $logfile -m $installmode $doreconfig || doExit cd ../.. fi @@ -278,7 +337,7 @@ fi `pwd`/bin/slapd/admin/bin/ns-update $silentarg $myargs -f $inffile | tee -a $logfile || doExit -`pwd`/bin/admin/ns-update $silentarg $myargs -f $inffile | tee -a $logfile || doExit +`pwd`/bin/admin/ns-update $doreconfig $silentarg $myargs -f $inffile | tee -a $logfile || doExit echo "INFO Finished with setup, logfile is setup/setup.log" | tee -a $logfile if [ -f setup/setup.log ] ; then diff --git a/ldap/cm/redhat-patch.inf b/ldap/cm/redhat-patch.inf index be5c87a6..5c48aa09 100644 --- a/ldap/cm/redhat-patch.inf +++ b/ldap/cm/redhat-patch.inf @@ -43,5 +43,4 @@ base: /share/dev4/fedora-ds/fds71/ships/20050526.1 file: 000001: README.txt -file: 000002: COPYRIGHT.txt - +file: 000002: lib/libback-ldbm.* |