diff options
-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 |