summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormariamj <mariamj@us.ibm.com>2016-03-11 10:33:03 -0500
committermariam john <mariamj@us.ibm.com>2016-03-12 23:04:19 +0000
commit23f614ce1ecd92d3376f599c13920ff921d5e62f (patch)
tree3259c6bf67beee5e40c9b04d4e428d7cfcc76e37
parentfd2442a7f227931f7100765d37c7da95b6fa5abe (diff)
downloadtrove-integration-23f614ce1ecd92d3376f599c13920ff921d5e62f.tar.gz
Fix the issue with DB2 install
DB2 installation fails because the hostname cannot be correctly resolved. This was caused by the change in: https://review.openstack.org/#/c/272711/. The change includes adding '127.0.0.1 <hostname>' to the /etc/hosts file before the actual installation and deleting this entry from /etc/hosts once the installation is complete. To make this complete, a change is added to the guest agent to update the db2 settings for hostname: https://review.openstack.org/#/c/291820/ Change-Id: Ia9dad59b9b40e7df66f3b1659e529eb32bf91f17 Closes-Bug: #1556159
-rwxr-xr-xscripts/files/elements/ubuntu-db2/install.d/10-db29
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/files/elements/ubuntu-db2/install.d/10-db2 b/scripts/files/elements/ubuntu-db2/install.d/10-db2
index 8628586..63bc3bf 100755
--- a/scripts/files/elements/ubuntu-db2/install.d/10-db2
+++ b/scripts/files/elements/ubuntu-db2/install.d/10-db2
@@ -12,6 +12,10 @@ DB2_PKG_LOCATION="/db2"
mkdir ${DB2_PKG_LOCATION}
cd ${DB2_PKG_LOCATION}
+# DB2 install requires the hostname to be resolved correctly
+host_name=`hostname`
+echo "127.0.0.1 ${host_name}" >> /etc/hosts
+
tar -xvzf /tmp/in_target.d/db2.tar.gz
# installing dependencies
@@ -41,3 +45,8 @@ su - db2inst1 -c "db2 update database manager configuration using svcename db2c_
# Start the actual TCP/IP communication.
su - db2inst1 -c "db2set DB2COMM=tcpip"
+
+# DB2 requires the hostname to be resolved correctly. Delete this entry from the
+# /etc/hosts since this is the hostname of the instance where the image is being
+# built. The correct hostname will be set in the guest agent.
+sed -i "/127.0.0.1[[:space:]]*${host_name}/d" /etc/hosts