Shutting service down via subscribed event using TMIB or system call
785961Jul 19 2010 — edited Mar 13 2012I have a client that performs a tppost of a database event(in this case a oracle RAC FAN event indicating a down node). I created another server that subscribes to this event. At this point I have had issues. From the server I am unable to perform a system call of tmshutdown and tmboot.
It performs the tmshutdown but not the tmboot. When i do the same thing from a client I have no issues. Is there something unique about the tuxedo server main preventing me from doing a system call effectively? The TMIB calls appear to work ok also but do nto restart the server. If someone has an idea thanks.
I then tried to perform the activity via TMIB calls but also had not luck:
void DBSTATECHGSERV(TPSVCINFO *svcinfo)
{
char charBuf[2000];
FBFR32 *fbfr;
FLDLEN32 len;
char *pEventName = NULL;
int i=0;
FBFR32 ibuf = (FBFR32 )tpalloc((char *)FMLTYPE32, NULL, 0);
Fchg32(ibuf, TA_OPERATION, 0,(char*) "SET", 0);
Fchg32(ibuf, TA_CLASS, 0,(char*) "T_SERVER", 0);
Fchg32(ibuf, TA_GRPNO, 0, (char *)"1", 0);
Fchg32(ibuf, TA_SERVERNAME, 0, (char *)"ECHO", 0);
Fchg32(ibuf, TA_SRVID, 0, (char *)"10", 0);
Fchg32(ibuf, TA_STATE, 0, (char *)"DEA", 0);
int retc = tpcall((char *)".TMIB", (char *)ibuf, 0, (char **)&ibuf, &len, (l
ong)0);
//int retc = tpadmcall(ibuf, &ibuf, 0);
if ( retc < 0)
{
printf("tpadmcall() failed:%s\n",tpstrerror(tperrno));
}
Fchg32(ibuf, TA_OPERATION, 0,(char*) "SET", 0);
Fchg32(ibuf, TA_CLASS, 0,(char*) "T_SERVER", 0);
Fchg32(ibuf, TA_GRPNO, 0, (char *)"1", 0);
Fchg32(ibuf, TA_SERVERNAME, 0, (char *)"ECHO", 0);
Fchg32(ibuf, TA_SRVID, 0, (char *)"10", 0);
Fchg32(ibuf, TA_STATE, 0, (char *)"ACT", 0);
retc = tpcall((char *)".TMIB", (char *)ibuf, 0, (char **)&ibuf, &len, (long)
0);
//int retc = tpadmcall(ibuf, &ibuf, 0);
if ( retc < 0)
{
printf("tpadmcall() failed:%s\n",tpstrerror(tperrno));
}
tpfree((char *)ibuf);
userlog("got the subscription ");
execl("/home/hems/prod/getit.sh","","getit.sh", NULL);
i = system("getit.sh ");
userlog("return value from system call %d ",i);
//i = system("tmboot -yg -yg TESTGRP_1 ");
//userlog("return value from system call %d ",i);
tpreturn(TPSUCCESS, 0, NULL, 0, 0);