Has anyone done chroot for Db2 LUW?

49 views Asked by At

I am attempting chroot of Db2 LUW. I've copied all the dependent libraries, executables in the chroot directory. All Db2 commands like db2 CLP, db2trc are working fine. However, when I attempt to start Db2 using db2start, it gives me an error (in db2trc):

Data1 (PD_TYPE_STRING,95) String: database monitor initialization was skipped, instance home directory may be mounted with nosuid

From db2trc, the db2diag.log message is:

49655 | | | | | sqlnlsMessage data [probe 170]

    bytes 136

    Data1   (PD_TYPE_DEFAULT,128) Hexdump:
    5351 4C31 3634 314E 2020 5468 6520 6462    SQL1641N  The db
    3273 7461 7274 2063 6F6D 6D61 6E64 2066    2start command f
    6169 6C65 6420 6265 6361 7573 6520 6F6E    ailed because on
    6520 6F72 206D 6F72 6520 6461 7461 6261    e or more databa
    7365 200A 6D61 6E61 6765 7220 7072 6F67    se .manager prog
    7261 6D20 6669 6C65 7320 7761 7320 7072    ram files was pr
    6576 656E 7465 6420 6672 6F6D 2065 7865    evented from exe
    6375 7469 6E67 2077 6974 6820 726F 6F74    cuting with root

The command I am using is:

usr/bin/sudo /usr/bin/setpriv --no-new-privs /usr/bin/prlimit --fsize=unlimited:unlimited --data=unlimited:unlimited --nofile=1048576:1048576 --core=unlimited:unlimited --stack=unlimited: --nproc=unlimited:unlimited /usr/sbin/chroot --userspec:db2inst1:db2inst1 --groups:db2inst1 /db2root /bin/bash

bash> source /home/db2inst1/sqllib/db2profile bash> db2start

Before running the command I did this:

mkdir -p /db2root/home/db2inst1 mount --bind /home/db2inst1 /db2root/home/db2inst1 && mount -o "remount,bind,rw" /db2root/home/db2inst1

This gives me error: SQL1042. In the diaglog I see the msg above and the pid which failed shows the "instance home directory maybe mounted with nosuid".

Was wondering if anyone has attempted this before and overcome the problem ?

I tried even removing the "rw" option from mount, but that gave the same error.

Normal root installation using 11.5.8 on Linux. db2setup -f ../db2server.rsp The installation I put in a separate filesystem named /db2bin/db After that I ran db2icrt db2icrt -u db2fenc1 db2inst1

When I log in as user db2inst1 everything works fine i.e. Db2 starts up normally.

0

There are 0 answers