Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

A Tuxedo server hangs at tmboot with Tuxedo 12.1.3, but works fine with 10.0

user7778759Mar 11 2015 — edited Mar 20 2015

We have been running a Tuxedo server with pretty much the same logic in the sample code below in our systems for years on AIX (OS level 6100) with Tuxedo 10-32 bit. We are upgrading to Tuxedo 12.1.3 (12cr2) now. The code is compiled fine with Tuxedo 12, however, it just hangs at tmboot. We have tried on multiple servers (all AIX), but it hung on all the servers with tmboot. Is there anyone in the forum ran into the same problem?

The source code ForkSrv.c:

#include <unistd.h>
#include <signal.h>
#include <atmi.h>

void    doChildProcess();
void    launchChildProcess();

static pid_t m_iChildPid = -1;

/** FUNCTION: tpsvrinit */
int tpsvrinit( int argc, char **argv ) {
  launchChildProcess();
  userlog("Service initilized: (pid=%d)\n", getpid());
}

/* FUNCTION: killChild
*  DESCRIPTION: send SIGTERM to the child process and wait for it terminates.  */
void killChild() {
  int iChildStatus;
  if (m_iChildPid>0)
  {
    kill(m_iChildPid, SIGTERM);
    userlog("Service (pid=%d) kill child process %d\n",
          getpid(), m_iChildPid);

    wait(&iChildStatus);
    userlog("Service (pid=%d) killed child process %d\n",
          getpid(), m_iChildPid);
  }
}

/** FUNCTION: tpsvrdone
*  DESCRIPTION: terminate the child process and do other clean ups */
void tpsvrdone(void) {
  killChild();
  userlog("Service done: (pid=%d)\n", getpid());
}

/*  FUNCTION: ForkSvc
*  DESCRIPTION: service function */
void ForkSvc(TPSVCINFO *tpinfo)
{
  userlog("Service call: (pid=%d)\n", getpid());
  tpreturn(TPSUCCESS, 0, tpinfo->data, 0, 0);
}

/*  FUNCTION: launchChildProcess
*  DESCRIPTION: launch the child process. If the child process exists terminate it first.  */

void launchChildProcess()
{
  m_iChildPid = fork();
  switch (m_iChildPid) {
  case -1:/* error */
    userlog("launchChildProcess: Service failed to fork: (pid=%d)\n", getpid());
    break;
  case 0:/* child */
    doChildProcess();
    exit(0);
    break;
  default:/* parent */
    userlog("launchChildProcess: Child created with pid=%d\n", m_iChildPid);
    break;
  }
}

/*  FUNCTION: doChildProcess
*  DESCRIPTION: child process routing */
void doChildProcess()
{
  sleep(100000);
  userlog("doChildProcess: Service child exited: (pid=%d)\n", getpid());
  exit(0);
}

The Makefile fork.mak:
CC=cc
SERVERS=ForkSrv
server: $(SERVERS)

all:ForkSrv
ForkSrv: ForkSrv.o
        buildserver -t -o ForkSrv -s ForkSvc -f ForkSrv.o
ForkSrv.o:ForkSrv.c
        $(CC) -c -I${TUXDIR}/include -o ForkSrv.o ForkSrv.c

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 17 2015
Added on Mar 11 2015
8 comments
1,767 views