I am trying to install and start db2 on my linux machine using the following script:
#!/usr/bin/env bash
MKDIR=/bin/mkdir
RM=/bin/rm
TAR=/bin/tar
DB2_SERVER_PROGRAM_PATH=/home/alok/Documents/Installers
DB2_SERVER_PROGRAM=v10.5_linuxx64_expc.tar.gz
echo "changing to $DB_SERVER_PROGRAM_PATH"
cd ${DB2_SERVER_PROGRAM_PATH}
echo "removing expc"
${RM} -rf expc
echo "untarring ${DB2_SERVER_PROGRAM}"
${TAR} zxf ${DB2_SERVER_PROGRAM}
echo "changing to expc"
cd expc
echo "Installing db2 as root"
sudo ./db2_install
echo "Adding user group db2grp1 as root"
sudo groupadd db2grp1
echo "Adding user group dasadm1 as root"
sudo groupadd dasadm1
echo "Adding user group db2fgrp1 as root"
sudo groupadd db2fgrp1
echo "Adding user db2inst1. Please provide password for new user db2inst1."
sudo useradd -g db2grp1 -G dasadm1 -m db2inst1
sudo passwd db2inst1
echo "Adding user dasusr1. Please provide password for new user dasusr1."
sudo useradd -g dasadm1 -G db2grp1 -m dasusr1
sudo passwd dasusr1
echo "Adding user db2fenc1. Please provide password for new user db2fenc1."
sudo useradd -g db2fgrp1 -m db2fenc1
sudo passwd db2fenc1
cd /opt/ibm/db2/V10.5/instance
echo "Creating DAS as root via user dasusr1."
sudo ./dascrt -u dasusr1
echo "Creating database instance as root via user db2fenc1 and db2inst1."
sudo ./db2icrt -u db2fenc1 db2inst1
echo "Setting communication protocol to tcpip as user db2inst1."
sudo -u db2inst1 ../adm/db2set DB2COMM=tcpip
echo "Setting SVCENAME 50000 for dbm cfg as user db2inst1."
sudo -u db2inst1 ../bin/db2 update dbm cfg using SVCENAME 50000
echo "starting db2 as user db2inst1."
sudo chmod +x ../adm/db2start
sudo -u db2inst1 ../adm/db2start
netstat -an | grep 50000
Everything works fine, till I get to the penultimate line:
sudo -u db2inst1 ../adm/db2start
SQL1641N The db2start command failed because one or more DB2 database
manager program files was prevented from executing with root
privileges by file system mount settings.
Now I checked /etc/fstab
and it says:
proc /proc proc nodev,noexec,nosuid 0 0
/dev/sda1 / ext4 errors=remount-ro,user_xattr 0 1
UUID=d4d794eb-1e68-4ddf-a9ec-249a22f084fb none swap sw 0 0
/swapfile swap swap defaults 0 0
My installation path, /opt/ibm/db2/V10.5/adm
is basically on /dev/sda1
and it's not mounted using the nosuid
option.
Here is the output of mount
:
alok@hostname:~$ mount
/dev/sda1 on / type ext4 (rw,errors=remount-ro,user_xattr)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
none on /sys/fs/fuse/connections type fusectl (rw)
none on /sys/kernel/debug type debugfs (rw)
none on /sys/kernel/security type securityfs (rw)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
none on /run/lock type tmpfs (rw,noexec,nosuid,nodev,size=5242880)
none on /run/shm type tmpfs (rw,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
shmfs on /dev/shm type tmpfs (rw,size=2048m)
gvfs-fuse-daemon on /home/alok/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=alok)
This again indicates that /
is not mounted in nosuid
mode.
So why am I getting error SQL1641N
? Is it a different problem throwing out this message instead?