summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoriko Hosoi <nhosoi@redhat.com>2005-09-28 22:47:14 +0000
committerNoriko Hosoi <nhosoi@redhat.com>2005-09-28 22:47:14 +0000
commitf8d0ff48c9572383bdb7c76d074f75870e47fb78 (patch)
treea35117aee11f20a1349192635c3e66d4ac930e2a
parent547be1b93b5b8805b32b53eb6da31c3c4953506c (diff)
downloadds-f8d0ff48c9572383bdb7c76d074f75870e47fb78.tar.gz
ds-f8d0ff48c9572383bdb7c76d074f75870e47fb78.tar.xz
ds-f8d0ff48c9572383bdb7c76d074f75870e47fb78.zip
[167982] Service Pack framework
To make patch installation easier and less confusing, 1) adding a setup wrapper (ldap/cm/newinst/setup.patch) for Solaris and HP as well as 2) adding some code to RPM setup script (ldap/cm/newinst/setup) for RHELs, which checks the existing server config files and retrieves the values needed for the upgrade.
-rw-r--r--ldap/cm/Makefile5
-rw-r--r--ldap/cm/fedora-patch.inf3
-rwxr-xr-xldap/cm/newinst/setup62
-rwxr-xr-xldap/cm/newinst/setup.patch155
-rw-r--r--ldap/cm/redhat-patch.inf3
5 files changed, 224 insertions, 4 deletions
diff --git a/ldap/cm/Makefile b/ldap/cm/Makefile
index bbb61f52..dc64fe48 100644
--- a/ldap/cm/Makefile
+++ b/ldap/cm/Makefile
@@ -813,13 +813,14 @@ ifdef BUILD_PATCH
cp $(INSTDIR)/dssetup $(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) ; \
@@ -829,7 +830,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 66300595..83fed178 100644
--- a/ldap/cm/fedora-patch.inf
+++ b/ldap/cm/fedora-patch.inf
@@ -38,7 +38,7 @@
#
# Info file to generate DS7.1 SP1 patch
# base: <builddir> containing the base package -- DS7.1
-# file: <patchfile>
+# file: bug#: <patchfile>
#
base: /share/dev4/fedora-ds/fds71/ships/20050526.1
@@ -56,6 +56,7 @@ file: 167478,160589: setup/setup
file: 156120,159037: winsync/PassSync.msi
file: 156120,159037: winsync/ntds.msi
file: 167761: java/jars/ds71.jar
+file: 169388: lib/replication-plugin.*
file: xxxxxx: bin/slapd/README.txt
file: xxxxxx: README.txt
diff --git a/ldap/cm/newinst/setup b/ldap/cm/newinst/setup
index c3ea5191..69543500 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=
@@ -192,6 +199,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
diff --git a/ldap/cm/newinst/setup.patch b/ldap/cm/newinst/setup.patch
new file mode 100755
index 00000000..b0aee3c8
--- /dev/null
+++ b/ldap/cm/newinst/setup.patch
@@ -0,0 +1,155 @@
+#!/bin/sh
+#
+# BEGIN COPYRIGHT BLOCK
+# This Program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation; version 2 of the License.
+#
+# This Program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA.
+#
+# In addition, as a special exception, Red Hat, Inc. gives You the additional
+# right to link the code of this Program with code not covered under the GNU
+# General Public License ("Non-GPL Code") and to distribute linked combinations
+# including the two, subject to the limitations in this paragraph. Non-GPL Code
+# permitted under this exception must only link to the code of this Program
+# through those well defined interfaces identified in the file named EXCEPTION
+# found in the source code files (the "Approved Interfaces"). The files of
+# Non-GPL Code may instantiate templates or use macros or inline functions from
+# the Approved Interfaces without causing the resulting work to be covered by
+# the GNU General Public License. Only Red Hat, Inc. may make changes or
+# additions to the list of Approved Interfaces. You must obey the GNU General
+# Public License in all respects for all of the Program code and other code used
+# in conjunction with the Program except the Non-GPL Code covered by this
+# exception. If you modify this file, you may extend this exception to your
+# version of the file, but you are not obligated to do so. If you do not wish to
+# provide this exception without modification, you must delete this exception
+# statement from your version and license this file solely under the GPL without
+# exception.
+#
+#
+# Copyright (C) 2005 Red Hat, Inc.
+# All rights reserved.
+# END COPYRIGHT BLOCK
+#
+
+#
+# This script is a wrapper for dssetup used for inplace upgrade / patch
+# installation.
+#
+clear
+
+echo " Fedora Project"
+echo " Fedora Server Products Installation/Uninstallation"
+echo "-------------------------------------------------------------------------------"
+echo ""
+echo ""
+echo "BY INSTALLING THIS SOFTWARE YOU ARE CONSENTING TO BE BOUND BY"
+echo "AND ARE BECOMING A PARTY TO THE AGREEMENT FOUND IN THE"
+echo "LICENSE.TXT FILE. IF YOU DO NOT AGREE TO ALL OF THE TERMS"
+echo "OF THIS AGREEMENT, PLEASE DO NOT INSTALL OR USE THIS SOFTWARE."
+echo ""
+printf "Do you agree to the license terms? [No]: "
+read ans
+
+if [ "$ans" != "Y" -a "$ans" != "YES" -a "$ans" != "Yes" -a "$ans" != "y" -a "$ans" != "yes" ]; then
+ exit 1;
+fi
+
+clear
+
+echo " Fedora Project"
+echo " Fedora Server Products Installation/Uninstallation"
+echo "-------------------------------------------------------------------------------"
+echo ""
+echo ""
+echo "This program will extract the patch files and install them"
+echo "into a directory where the Directory Server is already installed."
+echo ""
+echo "To accept the default shown in brackets, press the Enter key."
+echo ""
+printf "Install location [/opt/fedora/servers]: "
+read serverroot
+
+if [ ! -d $serverroot ]; then
+ echo ""
+ echo "Directory $serverroot does not exist."
+ exit 1
+fi
+
+if [ ! -f $serverroot/admin-serv/config/adm.conf ]; then
+ echo ""
+ echo "Administration Server's configuration file $serverroot/admin-serv/config/adm.conf does not exist."
+ exit 1
+fi
+
+getValFromAdminConf() {
+ cattr=$1
+ cfile=$2
+ rval=`grep -i $cattr $serverroot/admin-serv/config/$cfile | awk '{print $2}'`
+ echo $rval
+}
+
+dsinst=`getValFromAdminConf "ldapStart:" "adm.conf" | awk -F/ '{print $1}'`
+dsconffile=$serverroot/$dsinst/config/dse.ldif
+if [ ! -f $dsconffile ]; then
+ echo ""
+ echo "Directory Server's configuration file $dsconffile does not exist."
+ exit 1
+fi
+
+clear
+
+ldaphost=`getValFromAdminConf "ldapHost:" "adm.conf"`
+ldapport=`getValFromAdminConf "ldapPort:" "adm.conf"`
+siepid=`getValFromAdminConf "siepid:" "adm.conf"`
+suitespotuser=`ls -l $dsconffile | awk '{print $3}'`
+suitespotgroup=`ls -l $dsconffile | 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 " Fedora Project"
+echo " Directory Installation/Uninstallation"
+echo "-------------------------------------------------------------------------------"
+echo ""
+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=./myinstall.inf
+
+echo "[General]" > $inffile
+echo "FullMachineName= $ldaphost" >> $inffile
+echo "SuiteSpotUserID= $suitespotuser" >> $inffile
+echo "SuitespotGroup= $suitespotgroup" >> $inffile
+echo "ServerRoot= $serverroot" >> $inffile
+echo "ConfigDirectoryLdapURL= ldap://$ldaphost:$ldapport/" >> $inffile
+echo "ConfigDirectoryAdminID= $siepid" >> $inffile
+echo "AdminDomain= $admindomain" >> $inffile
+echo "ConfigDirectoryAdminPwd= $siepasswd" >> $inffile
+echo "Components= slapd-71sp1" >> $inffile
+echo "" >> $inffile
+echo "[slapd-71sp1]" >> $inffile
+echo "Components= slapd-71sp1" >> $inffile
+
+clear
+
+./dssetup -s -f $inffile
diff --git a/ldap/cm/redhat-patch.inf b/ldap/cm/redhat-patch.inf
index 9192ebe4..6e299ebf 100644
--- a/ldap/cm/redhat-patch.inf
+++ b/ldap/cm/redhat-patch.inf
@@ -38,7 +38,7 @@
#
# Info file to generate DS7.1 SP1 patch
# base: <builddir> containing the base package -- DS7.1
-# file: <patchfile>
+# file: bug#: <patchfile>
#
base: /share/dev4/ds/ds71/ships/20050524.1
@@ -56,5 +56,6 @@ file: 167478,160589: setup/setup
file: 156120,159037: winsync/PassSync.msi
file: 156120,159037: winsync/ntds.msi
file: 167761: java/jars/ds71.jar
+file: 169388: lib/replication-plugin.*
file: xxxxxx: bin/slapd/README.txt
file: xxxxxx: README.txt