00001
00002
00003
00004
00005
00006
00007
00008 #include <SUM.h>
00009 #include <sys/socket.h>
00010 #include <sys/errno.h>
00011 #include <sys/time.h>
00012 #include <rpc/rpc.h>
00013 #include <rpc/pmap_clnt.h>
00014 #include <signal.h>
00015 #include <sum_rpc.h>
00016 #include <soi_error.h>
00017 #if defined(SUMS_TAPE_AVAILABLE) && SUMS_TAPE_AVAILABLE
00018 #include <tape.h>
00019 #endif
00020 #include <printk.h>
00021 #include <unistd.h>
00022 #include "serverdefs.h"
00023
00024 extern PART ptabx[];
00025
00026 void logkey();
00027 extern int errno;
00028 extern Sinfoarray sarray;
00029 static void sumprog_1();
00030 static void sumprog_1_array();
00031 struct timeval TIMEOUT = { 10, 0 };
00032 uint32_t rinfo;
00033 uint32_t sumprog, sumvers;
00034 int rrid = 0;
00035 float ftmp;
00036 char jsoc_machine[MAX_STR];
00037 static struct timeval first[4], second[4];
00038
00039 FILE *logfp;
00040 CLIENT *current_client, *clnttape, *clnttape_old;
00041 SVCXPRT *glb_transp;
00042 char *dbname;
00043 char thishost[MAX_STR];
00044 char usedhost[MAX_STR];
00045 char hostn[MAX_STR];
00046 char logname[MAX_STR];
00047 char newlogname[MAX_STR];
00048 char datestr[32];
00049 char timetag[32];
00050 int thispid;
00051 int soi_errno = NO_ERROR;
00052 int debugflg = 0;
00053 int sim = 0;
00054 int tapeoffline = 0;
00055 int newlog = 0;
00056 int logcnt = 0;
00057
00058
00059 void StartTimer(int n)
00060 {
00061 gettimeofday (&first[n], NULL);
00062 }
00063
00064 float StopTimer(int n)
00065 {
00066 gettimeofday (&second[n], NULL);
00067 if (first[n].tv_usec > second[n].tv_usec) {
00068 second[n].tv_usec += 1000000;
00069 second[n].tv_sec--;
00070 }
00071 return (float) (second[n].tv_sec-first[n].tv_sec) +
00072 (float) (second[n].tv_usec-first[n].tv_usec)/1000000.0;
00073 }
00074
00075
00076 void open_log(char *filename)
00077 {
00078 if((logfp=fopen(filename, "a+")) == NULL) {
00079 fprintf(stderr, "Can't open the log file %s\n", filename);
00080 }
00081 }
00082
00083
00084
00085
00086 char *datestring()
00087 {
00088 struct timeval tvalr;
00089 struct tm *t_ptr;
00090
00091 gettimeofday(&tvalr, NULL);
00092 t_ptr = localtime((const time_t *)&tvalr);
00093 sprintf(datestr, "%s", asctime(t_ptr));
00094 datestr[19] = (char)NULL;
00095 return(&datestr[4]);
00096 }
00097
00098
00099 char *gettimetag()
00100 {
00101 struct timeval tvalr;
00102 struct tm *t_ptr;
00103
00104 gettimeofday(&tvalr, NULL);
00105 t_ptr = localtime((const time_t *)&tvalr);
00106 sprintf(timetag, "%04d.%02d.%02d.%02d%02d%02d",
00107 (t_ptr->tm_year+1900), (t_ptr->tm_mon+1), t_ptr->tm_mday, t_ptr->tm_hour, t_ptr->tm_min, t_ptr->tm_sec);
00108 return(timetag);
00109 }
00110
00111
00112
00113
00114 int write_log(const char *fmt, ...)
00115 {
00116 va_list args;
00117 char string[4096];
00118
00119 va_start(args, fmt);
00120 vsprintf(string, fmt, args);
00121 if(logfp) {
00122 fprintf(logfp, string);
00123 fflush(logfp);
00124 }
00125 else
00126 fprintf(stderr, string);
00127 va_end(args);
00128 return(0);
00129 }
00130
00131
00132 void sighandler(sig)
00133 int sig;
00134 {
00135 printf("sig = %d\n", sig);
00136 if(sig == SIGTERM) {
00137 write_log("*** %s Sopen got SIGTERM. Exiting.\n", datestring());
00138 exit(1);
00139 }
00140 if(sig == SIGINT) {
00141 write_log("*** %s Sopen got SIGINT. Exiting.\n", datestring());
00142 DS_DisConnectDB();
00143 exit(1);
00144 }
00145 write_log("*** %s Sopen got an illegal signal %d, ignoring...\n",
00146 datestring(), sig);
00147 if (signal(SIGINT, SIG_IGN) != SIG_IGN)
00148 signal(SIGINT, sighandler);
00149 if (signal(SIGALRM, SIG_IGN) != SIG_IGN)
00150 signal(SIGALRM, sighandler);
00151 }
00152
00153
00154
00155
00156 void usr1_sig(int sig)
00157 {
00158 write_log("%s usr1_sig received by Sopen\n", datestring());
00159
00160 logcnt++;
00161 write_log("%s Closing the current log file. Goodby.\n", datestring());
00162 fclose(logfp);
00163 sprintf(newlogname, "%s_%d", logname, logcnt);
00164 open_log(newlogname);
00165 write_log("\n## %s reopen log Sopen on %s for pid = %d ##\n",
00166 datestring(), thishost, thispid);
00167 signal(SIGUSR1, &usr1_sig);
00168 }
00169
00170
00171 void get_cmd(int argc, char *argv[])
00172 {
00173 int c;
00174 char *username, *cptr, *cptr2;
00175
00176 if(!(username = (char *)getenv("USER"))) username = "nouser";
00177 if(strcmp(username, SUMS_MANAGER)) {
00178 printf("!!NOTE: You must be user %s to run sum_svc!\n", SUMS_MANAGER);
00179 exit(1);
00180 }
00181
00182 while((--argc > 0) && ((*++argv)[0] == '-')) {
00183 while((c = *++argv[0])) {
00184 switch(c) {
00185 case 'd':
00186 debugflg=1;
00187 break;
00188 case 's':
00189 sim=1;
00190 break;
00191 case 'o':
00192 tapeoffline=1;
00193 break;
00194 default:
00195 break;
00196 }
00197 }
00198 }
00199 if(argc != 2) {
00200 printf("!!ERROR: program needs 2 args: dbname and logfilename. e.g:\n");
00201 printf("Sopen jsoc_sums sum_svc_2011.06.06.140140.log\n");
00202 exit(1);
00203 }
00204 dbname = argv[0];
00205
00206
00207
00208 sprintf(logname, "%s/%s", SUMLOG_BASEDIR, argv[1]);
00209 if(cptr = strstr(logname, "_R")) {
00210 if(cptr2 = strstr(logname, "log_R")) {
00211 *(cptr2+3) = (char)NULL;
00212 logcnt = 0;
00213 open_log(logname);
00214 }
00215 else if(cptr2 = strstr(logname, "log_")) {
00216 *cptr= (char)NULL;
00217 open_log(logname);
00218 *(cptr2+3) = (char)NULL;
00219 cptr2 = cptr2 + 4;
00220 sscanf(cptr2, "%d", &logcnt);
00221 }
00222 else {
00223 printf("!!ERROR: called with NG log file name: %s\n", logname);
00224 exit(1);
00225 }
00226 }
00227 else { open_log(logname); }
00228 }
00229
00230
00231 void setup()
00232 {
00233 FILE *fplog;
00234 int tpid, i;
00235 char *cptr, *machine;
00236 char lfile[MAX_STR], acmd[MAX_STR], line[MAX_STR];
00237
00238
00239
00240
00241
00242 sprintf(thishost, "localhost");
00243 gethostname(hostn, 80);
00244 cptr = index(hostn, '.');
00245 if(cptr) *cptr = (char)NULL;
00246
00247 sumprog = SUMOPEN;
00248 sumvers = SUMOPENV;
00249
00250 thispid = getpid();
00251 if(!(machine = (char *)getenv("JSOC_MACHINE"))) {
00252 sprintf(jsoc_machine, "NOTGIVEN");
00253 write_log("!!WARNING: No JSOC_MACHINE in env\n");
00254 write_log("SUMLIB_InfoGetArray() calls will fail\n");
00255 }
00256 else
00257 sprintf(jsoc_machine, "%s", machine);
00258
00259
00260 printk_set(write_log, write_log);
00261 write_log("\n## %s Sopen on %s (%s) for pid = %d ##\n",
00262 datestring(), thishost, hostn, thispid);
00263
00264
00265 signal(SIGINT, sighandler);
00266 if (signal(SIGTERM, SIG_IGN) != SIG_IGN)
00267 signal(SIGTERM, sighandler);
00268 if (signal(SIGALRM, SIG_IGN) != SIG_IGN)
00269 signal(SIGALRM, sighandler);
00270 signal(SIGUSR1, &usr1_sig);
00271
00272
00273
00274 sprintf(lfile, "/tmp/find_tview.log");
00275 sprintf(acmd, "ps -ef | grep %s 1> %s 2>&1", TAPEVIEWERNAME, lfile);
00276 if(system(acmd)) {
00277 write_log("**Can't execute %s.\n", acmd);
00278 return;
00279 }
00280 if((fplog=fopen(lfile, "r")) == NULL) {
00281 write_log("**Can't open %s to find any %s\n", lfile, TAPEVIEWERNAME);
00282 return;
00283 }
00284 while(fgets(line, 128, fplog)) {
00285 if(!(strstr(line, "perl"))) continue;
00286 sscanf(line, "%s %d", acmd, &tpid);
00287 sprintf(lfile, "%s/sum_restart_%d.touch", SUMLOG_BASEDIR, tpid);
00288 sprintf(acmd, "/bin/touch %s", lfile);
00289 write_log("%s\n", acmd);
00290 system(acmd);
00291 }
00292 fclose(fplog);
00293 }
00294
00295
00296 void sumbye(void) {
00297 printf("sumbye() called by atexit() at %s\n", datestring());
00298 write_log("sumbye() called by atexit() at %s\n", datestring());
00299 }
00300
00301
00302 int main(int argc, char *argv[])
00303 {
00304 register SVCXPRT *transp;
00305 int i;
00306 pid_t pid;
00307 char dsvcname[80], cmd[128];
00308 char *args[5], pgport[32];
00309 char *simmode;
00310
00311 get_cmd(argc, argv);
00312 printf("\nPlease wait for sum_svc and tape inventory to initialize...\n");
00313 setup();
00314 if(atexit(sumbye)) {
00315 printf("Can't register sumbye() function in atexit()\n");
00316 }
00317
00318
00319 (void) pmap_unset(SUMOPEN, SUMOPENV);
00320 transp = (SVCXPRT *)svctcp_create(RPC_ANYSOCK, 0, 0);
00321 if (transp == NULL) {
00322 write_log("***cannot create tcp service\n");
00323 exit(1);
00324 }
00325 write_log("svctcp_create() port# = %u\n", transp->xp_port);
00326 if (!svc_register(transp, SUMOPEN, SUMOPENV, sumprog_1, IPPROTO_TCP)) {
00327 write_log("***unable to register (SUMOPEN, SUMOPENV, tcp)\n");
00328 exit(1);
00329 }
00330
00331
00332 if(!(simmode = (char *)getenv("SUMSIMMODE"))) {
00333 sprintf(pgport, SUMPGPORT);
00334 setenv("SUMPGPORT", pgport, 1);
00335 write_log("Sopen sets SUMPGPORT env to %s\n", pgport);
00336 }
00337 else {
00338 write_log("Sopen sim mode SUMPGPORT %s\n", (char *)getenv("SUMPGPORT"));
00339 }
00340
00341 #ifndef __LOCALIZED_DEFS__
00342
00343
00344
00345 if(!strcmp(hostn, "dcs0") || !strcmp(hostn, "dcs1") || !strcmp(hostn, "dcs2") || !strcmp(hostn, "dcs3")) {
00346 if((pid = fork()) < 0) {
00347 write_log("***Can't fork(). errno=%d\n", errno);
00348 exit(1);
00349 }
00350 else if(pid == 0) {
00351 write_log("execvp of tape_svc\n");
00352 args[0] = "tape_svc";
00353 if(tapeoffline) {
00354 args[1] = "-o";
00355 args[2] = dbname;
00356 args[3] = timetag;
00357 args[4] = NULL;
00358 }
00359 else if(sim) {
00360 args[1] = "-s";
00361 args[2] = dbname;
00362 args[3] = timetag;
00363 args[4] = NULL;
00364 }
00365 else {
00366 args[1] = dbname;
00367 args[2] = timetag;
00368 args[3] = NULL;
00369 }
00370 if(execvp(args[0], args) < 0) {
00371 write_log("***Can't execvp() tape_svc. errno=%d\n", errno);
00372 exit(1);
00373 }
00374 }
00375 sleep(1);
00376 for(i=0; i < MAX_DRIVES; i++) {
00377 if((pid = fork()) < 0) {
00378 write_log("***Can't fork(). errno=%d\n", errno);
00379 exit(1);
00380 }
00381 else if(pid == 0) {
00382 sprintf(dsvcname, "drive%d_svc", i);
00383 write_log("execvp of %s\n", dsvcname);
00384 args[0] = dsvcname;
00385 if(tapeoffline) {
00386 args[1] = "-o";
00387 args[2] = dbname;
00388 args[3] = timetag;
00389 args[4] = NULL;
00390 }
00391 else if(sim) {
00392 args[1] = "-s";
00393 args[2] = dbname;
00394 args[3] = timetag;
00395 args[4] = NULL;
00396 }
00397 else {
00398 args[1] = dbname;
00399 args[2] = timetag;
00400 args[3] = NULL;
00401 }
00402 if(execvp(args[0], args) < 0) {
00403 write_log("***Can't execvp() %s. errno=%d\n", dsvcname, errno);
00404 exit(1);
00405 }
00406 }
00407 }
00408 if((pid = fork()) < 0) {
00409 write_log("***Can't fork(). errno=%d\n", errno);
00410 exit(1);
00411 }
00412 else if(pid == 0) {
00413 write_log("execvp of robot0_svc\n");
00414 args[0] = "robot0_svc";
00415 args[1] = dbname;
00416 args[2] = timetag;
00417 args[3] = NULL;
00418 if(execvp(args[0], args) < 0) {
00419 write_log("***Can't execvp() robot0_svc. errno=%d\n", errno);
00420 exit(1);
00421 }
00422 }
00423 }
00424 #endif
00425 #ifdef __LOCALIZED_DEFS__
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443 #endif
00444
00445 #ifndef __LOCALIZED_DEFS__
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00487
00488
00489
00490 printf("\nsum_svc waiting for tape servers to start (approx 10sec)...\n");
00491 sleep(10);
00492
00493 if(strcmp(hostn, SUMSVCHOST)) {
00494 clnttape = clnt_create(thishost, TAPEPROG, TAPEVERS, "tcp");
00495 strcpy(usedhost, thishost);
00496 }
00497 else {
00498 clnttape = clnt_create(TAPEHOST, TAPEPROG, TAPEVERS, "tcp");
00499 strcpy(usedhost, TAPEHOST);
00500 }
00501 if(!clnttape) {
00502 clnt_pcreateerror("Can't get client handle to tape_svc");
00503 write_log("tape_svc not there on %s\n", usedhost);
00504 fprintf(stderr, "tape_svc not there on %s\n", usedhost);
00505 exit(1);
00506 }
00507 clnttape_old = clnttape;
00508 write_log("Sopen has connected to tape_svc on %s\n", usedhost);
00509
00510 #endif
00511
00512
00513
00514
00515
00516
00517 DS_ConnectDB(dbname);
00518 if(DS_PavailRequest2()) {
00519 write_log("***Can't SUM_Init()\n");
00520 exit(1);
00521 }
00522
00523 sleep(5);
00524 printf("Sopen now available\n");
00525
00526
00527
00528
00529
00530 svc_run();
00531 write_log("!!Fatal Error: svc_run() returned in sum_svc\n");
00532 exit(1);
00533 }
00534
00535
00536
00537
00538
00539 static void
00540 sumprog_1(rqstp, transp)
00541 struct svc_req *rqstp;
00542 SVCXPRT *transp;
00543 {
00544 char procname[128];
00545 uint64_t ck_client;
00546
00547
00548 union __svcargun {
00549 Rkey sumdo_1_arg;
00550 } argument;
00551 char *result, *call_err;
00552 enum clnt_stat clnt_stat;
00553
00554 bool_t (*xdr_argument)(), (*xdr_result)();
00555 char *(*local)();
00556
00557 if(rqstp->rq_proc == INFODOARRAY) {
00558 sumprog_1_array(rqstp, transp);
00559 return;
00560 }
00561
00562 switch (rqstp->rq_proc) {
00563 case NULLPROC:
00564 (void) svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL);
00565 return;
00566 break;
00567
00568
00569
00570
00571
00572
00573 case OPENDO:
00574 sprintf(procname, "OPENDO");
00575 xdr_argument = xdr_Rkey;
00576 xdr_result = xdr_uint32_t;
00577 local = (char *(*)()) opendo_1;
00578 break;
00579 case SHUTDO:
00580 sprintf(procname, "SHUTDO");
00581 xdr_argument = xdr_Rkey;
00582 xdr_result = xdr_uint32_t;
00583 local = (char *(*)()) shutdo_1;
00584 break;
00585 case ALLOCDO:
00586 sprintf(procname, "ALLOCDO");
00587 xdr_argument = xdr_Rkey;
00588 xdr_result = xdr_Rkey;
00589 local = (char *(*)()) allocdo_1;
00590 break;
00591 case INFODO:
00592 sprintf(procname, "INFODO");
00593 xdr_argument = xdr_Rkey;
00594 xdr_result = xdr_Rkey;
00595 local = (char *(*)()) infodo_1;
00596 break;
00597 case INFODOX:
00598 sprintf(procname, "INFODOX");
00599 xdr_argument = xdr_Rkey;
00600 xdr_result = xdr_Rkey;
00601 local = (char *(*)()) infodoX_1;
00602 break;
00603 case GETDO:
00604 sprintf(procname, "GETDO");
00605 xdr_argument = xdr_Rkey;
00606 xdr_result = xdr_Rkey;
00607 local = (char *(*)()) getdo_1;
00608 break;
00609 case PUTDO:
00610 sprintf(procname, "PUTDO");
00611 xdr_argument = xdr_Rkey;
00612 xdr_result = xdr_Rkey;
00613 local = (char *(*)()) putdo_1;
00614 break;
00615 case CLOSEDO:
00616 sprintf(procname, "CLOSEDO");
00617 xdr_argument = xdr_Rkey;
00618 xdr_result = xdr_uint32_t;
00619 local = (char *(*)()) closedo_1;
00620 break;
00621 case SUMRESPDO:
00622 sprintf(procname, "SUMRESPDO");
00623 xdr_argument = xdr_Rkey;
00624 xdr_result = xdr_Rkey;
00625 local = (char *(*)()) sumrespdo_1;
00626 break;
00627 case DELSERIESDO:
00628 sprintf(procname, "DELSERIESDO");
00629 xdr_argument = xdr_Rkey;
00630 xdr_result = xdr_uint32_t;
00631 local = (char *(*)()) delseriesdo_1;
00632 break;
00633 case NOPDO:
00634 sprintf(procname, "NOPDO");
00635 xdr_argument = xdr_Rkey;
00636 xdr_result = xdr_uint32_t;
00637 local = (char *(*)()) nopdo_1;
00638 break;
00639 case TAPERECONNECTDO:
00640 sprintf(procname, "TAPERESTARTDO");
00641 xdr_argument = xdr_Rkey;
00642 xdr_result = xdr_uint32_t;
00643 local = (char *(*)()) tapereconnectdo_1;
00644 break;
00645 case SUMREPARTN:
00646 sprintf(procname, "SUMREPARTN");
00647 xdr_argument = xdr_Rkey;
00648 xdr_result = xdr_uint32_t;
00649 local = (char *(*)()) repartndo_1;
00650 break;
00651 default:
00652 write_log("**sumprog_1() dispatch default procedure %d,ignore\n", rqstp->rq_proc);
00653 svcerr_noproc(transp);
00654 return;
00655 }
00656 bzero((char *)&argument, sizeof(argument));
00657 if (!svc_getargs(transp, (xdrproc_t)xdr_argument, (char *)&argument)) {
00658 write_log("***Error on svc_getargs()\n");
00659 svcerr_decode(transp);
00660
00661
00662
00663
00664 svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL);
00665 return;
00666
00667 }
00668 glb_transp = transp;
00669 result = (*local)(&argument, rqstp);
00670
00671
00672
00673 if(result) {
00674 if(result == (char *)1) {
00675
00676 }
00677 else {
00678 if(debugflg) {
00679 write_log("\n###KEYLIST at return in sum_svc\n");
00680 keyiterate(logkey, (KEY *)result);
00681 }
00682 if(current_client == 0) {
00683 write_log("***Error on clnt_call() back to orig sum_svc caller\n");
00684 write_log(" current_client was NULL\n");
00685 }
00686 else {
00687 ck_client = ((uint64_t)current_client & 0xfc00000000000000) >> 58;
00688 if(!((ck_client == 0) || (ck_client == 0x3f))) {
00689 write_log("***Error invalid current_client\n");
00690
00691
00692 }
00693 else {
00694 clnt_stat=clnt_call(current_client, RESPDO, (xdrproc_t)xdr_result,
00695 result, (xdrproc_t)xdr_void, 0, TIMEOUT);
00696 if(clnt_stat != 0) {
00697 clnt_perrno(clnt_stat);
00698 write_log("***Error on clnt_call() back to RESPDO procedure\n");
00699 write_log("***The original client caller has probably exited\n");
00700 call_err = clnt_sperror(current_client, "Err");
00701 write_log("%s\n", call_err);
00702 }
00703 clnt_destroy(current_client);
00704 }
00705 }
00706 freekeylist((KEY **)&result);
00707 }
00708 }
00709 else {
00710 }
00711 if (!svc_freeargs(transp, (xdrproc_t)xdr_argument, (char *)&argument)) {
00712 write_log("**unable to free arguments\n");
00713
00714 }
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730 return;
00731 }
00732
00733
00734
00735 static void
00736 sumprog_1_array(rqstp, transp)
00737 struct svc_req *rqstp;
00738 SVCXPRT *transp;
00739 {
00740 char procname[128];
00741 uint64_t ck_client;
00742
00743
00744 union __svcargun {
00745 Sunumarray sumdo_1_arg;
00746 } argument;
00747 char *result, *call_err;
00748 enum clnt_stat clnt_stat;
00749
00750 bool_t (*xdr_argument)(), (*xdr_result)();
00751 char *(*local)();
00752
00753 switch (rqstp->rq_proc) {
00754 case INFODOARRAY:
00755 sprintf(procname, "INFODOARRAY");
00756 xdr_argument = xdr_Sunumarray;
00757 xdr_result = xdr_Rkey;
00758 local = (char *(*)()) infodoArray_1;
00759 break;
00760 default:
00761 write_log("**sumprog_1_array() dispatch default procedure %d,ignore\n", rqstp->rq_proc);
00762 svcerr_noproc(transp);
00763 return;
00764 }
00765 bzero((char *)&argument, sizeof(argument));
00766 if (!svc_getargs(transp, (xdrproc_t)xdr_argument, (char *)&argument)) {
00767 write_log("***Error on svc_getargs()\n");
00768 svcerr_decode(transp);
00769
00770
00771
00772
00773 svc_sendreply(transp, (xdrproc_t)xdr_void, (char *)NULL);
00774 return;
00775
00776 }
00777 glb_transp = transp;
00778 result = (*local)(&argument, rqstp);
00779
00780
00781
00782 if(result) {
00783 if(result == (char *)1) {
00784
00785 }
00786 else {
00787 if(debugflg) {
00788 }
00789 if(current_client == 0) {
00790 write_log("***Error on clnt_call() back to orig sum_svc caller\n");
00791 write_log(" current_client was NULL\n");
00792 }
00793 else {
00794 ck_client = ((uint64_t)current_client & 0xfc00000000000000) >> 58;
00795 if(!((ck_client == 0) || (ck_client == 0x3f))) {
00796 write_log("***Error invalid current_client\n");
00797
00798
00799 }
00800 else {
00801 clnt_stat=clnt_call(current_client, RESPDOARRAY,(xdrproc_t)xdr_result, result, (xdrproc_t)xdr_void, 0, TIMEOUT);
00802 if(clnt_stat != RPC_SUCCESS) {
00803 if(clnt_stat != RPC_TIMEDOUT) {
00804 clnt_perrno(clnt_stat);
00805 write_log("***Error on clnt_call() back to RESPDO procedure\n");
00806 write_log("***The original client caller has probably exited\n");
00807 call_err = clnt_sperror(current_client, "Err");
00808 write_log("%s\n", call_err);
00809
00810 }
00811 else {
00812 write_log("Timeout ignored on RESPDO back to current_client\n");
00813 }
00814 }
00815 clnt_destroy(current_client);
00816 }
00817 }
00818 freekeylist((KEY **)&result);
00819 }
00820 }
00821 else {
00822 }
00823 if (!svc_freeargs(transp, (xdrproc_t)xdr_argument, (char *)&argument)) {
00824 write_log("**unable to free arguments\n");
00825
00826 }
00827
00828
00829 return;
00830 }
00831