Topic
  • 2 replies
  • Latest Post - ‏2014-08-20T11:30:17Z by memet_tiike
memet_tiike
memet_tiike
21 Posts

Pinned topic IBM DSWC and Repository DB on same machine - problem after reboot

‏2014-04-25T09:21:34Z |

Hi,

I have intalled IBM DSWC 4.1 on RHEL Linux. I also installed DB2 Express C for repository db on the same machine.

I have added the following line to crtontab of root so that IBM DSWC starts after reboot (I do not know another way, is there?):

@reboot /opt/IBM/DSWC4.1/bin/start.sh

for DB2 automatic instance start on reboot is enabled (db2iauto -on db2inst1).

The problem is that after a reboot, IBM DSWC starts before DB2 and IBM DSWC reports repository database status as : The repository database  is not active

How should be the proper configuration for my setup?

Thanks

  • HLHuang
    HLHuang
    37 Posts

    Re: IBM DSWC and Repository DB on same machine - problem after reboot

    ‏2014-05-14T23:32:02Z  

    Hi,

        I am not a Linux person.  However, I did get some information that you could use.  You could write a script file under /etc/init.d folder, say startDSWCAll.sh,and have a symbolic link in /etc/rc3.d   say S99StartDSWCAll to point to /etc/init,d/startDSWCAll.sh.  When the system reboot, it will run this script file. The reason call it S99xxxx is because S01xxx will be run first,  S99xxxx will be run later in the game. (That's how linux works).  And in that StartDSWCAll.sh.  You could write something like this: 

    #!/bin/sh

    echo starting...

    su - db2inst1 -c "db2start'
    su - db2inst1 -c "sh /opt.IBM/DSWC4.1/start.sh >/dev/null 2<&1"
    echo start successfully
    ;;
    #this is the end.

    run db2start first to make sure DB2 always started before DSWC start.  You could also google on how init.d or rc3.d works,  I just get this information from an linux expert.  :) 

     

  • memet_tiike
    memet_tiike
    21 Posts

    Re: IBM DSWC and Repository DB on same machine - problem after reboot

    ‏2014-08-20T11:30:17Z  

    Hi,

    I have found a workaround for this issue.

    1. On root's crontab the following line should exist

     @reboot sudo -u db2inst1 -i db2start && /opt/IBM/DSWC4.1/bin/start.sh

    which means "start db2 as user db2inst1 and then start DSWC".

    2. Since db2 is started manually, auto instance start should be disabled (db2iauto is set to OFF).

    3. On crontab sudo requires a tty by default, so it gives an error. To remove the error, a line in the sudoers file is edited as below (using visudo as root on RHEL)

    Defaults:db2inst1    !requiretty

    That is it, db2 repository and DSWC on the same machine, and system reboots and starts components properly.

    I hope this helps someone.