diff options
author | mariamj <mariamj@us.ibm.com> | 2016-03-11 10:33:03 -0500 |
---|---|---|
committer | mariam john <mariamj@us.ibm.com> | 2016-03-12 23:04:19 +0000 |
commit | 23f614ce1ecd92d3376f599c13920ff921d5e62f (patch) | |
tree | 3259c6bf67beee5e40c9b04d4e428d7cfcc76e37 | |
parent | fd2442a7f227931f7100765d37c7da95b6fa5abe (diff) | |
download | trove-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-x | scripts/files/elements/ubuntu-db2/install.d/10-db2 | 9 |
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 |