From 23f614ce1ecd92d3376f599c13920ff921d5e62f Mon Sep 17 00:00:00 2001 From: mariamj Date: Fri, 11 Mar 2016 10:33:03 -0500 Subject: 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 ' 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 --- scripts/files/elements/ubuntu-db2/install.d/10-db2 | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- cgit v1.2.1