Merge "Fix the issue with DB2 install"

This commit is contained in:
Jenkins 2016-03-14 19:28:03 +00:00 committed by Gerrit Code Review
commit e702dda2b5
1 changed files with 9 additions and 0 deletions

View File

@ -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