From: hadaq Date: Wed, 27 Jan 2010 17:10:34 +0000 (+0000) Subject: online service (rpc) disabled by default. Sergey. X-Git-Url: https://jspc29.x-matter.uni-frankfurt.de/git/?a=commitdiff_plain;h=a438b9105be0b65fb17313f2346c0f95233ad5ec;p=daqdata.git online service (rpc) disabled by default. Sergey. --- diff --git a/hadaq/evtbuild.c b/hadaq/evtbuild.c index b12a240..ec18322 100644 --- a/hadaq/evtbuild.c +++ b/hadaq/evtbuild.c @@ -1,4 +1,4 @@ -static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.97 2009-12-14 10:28:38 hadaq Exp $"; +static char *rcsId = "$Header: /misc/hadesprojects/daq/cvsroot/eventbuilder/hadaq/evtbuild.c,v 6.98 2010-01-27 17:10:34 hadaq Exp $"; #define _POSIX_C_SOURCE 199309L #define SYSLOG_NAMES @@ -83,7 +83,7 @@ typedef struct TheArgsS { char verbosity[PARAM_MAX_VALUE_LEN]; unsigned long evtId; unsigned long maxFileSz; - unsigned short no_rpc; + unsigned short online; unsigned int resdownscale; unsigned int resnumevents; char respath[PARAM_MAX_VALUE_LEN]; @@ -178,7 +178,7 @@ static void usage(const char *progName) syslog(LOG_ERR, "Usage: [--shmname shmem_name] extension of shared memory name to be opened"); syslog(LOG_ERR, "Usage: [-a (agent)] [-p priority] [-I evtId]"); syslog(LOG_ERR, "Usage: [-v debug|info|notice|warning|err|alert|crit|emerg]"); - syslog(LOG_ERR, "Usage: [--norpc]"); + syslog(LOG_ERR, "Usage: [--online 0|1] online service: 0=off, 1=on (default off)"); syslog(LOG_ERR, "Usage: [--filesize max_size] maximum size of output file in MB"); syslog(LOG_ERR, "Usage: [--resdownscale downscale_factor] downscale factor for the res events"); syslog(LOG_ERR, "Usage: [--resnumevents evt_num] maximum number of events in a resfile"); @@ -226,8 +226,8 @@ static void argsDump(TheArgs *my) syslog(LOG_DEBUG, "secsizelimit: %ld", my->secsizelimit); syslog(LOG_DEBUG, "ressizelimit: %d", my->ressizelimit); } - if (my->no_rpc == 1) { - syslog(LOG_DEBUG, "no rpc is set"); + if (my->online == 0) { + syslog(LOG_DEBUG, "no online service"); } if (my->write_data == 1) { syslog(LOG_DEBUG, "sec_path: %s", my->sec_path); @@ -263,7 +263,7 @@ static void argsDefault(TheArgs *my) strcpy(my->verbosity, "info"); my->evtId = 0; my->maxFileSz = (1.5 * 1024 * 1024 * 1024UL - 1); - my->no_rpc = 0; + my->online = 0; /* 0=off, 1=on */ my->write_data = 0; my->resdownscale = 0; my->resdown_offset = 0; @@ -297,7 +297,7 @@ static int argsFromCL(TheArgs *my, int argc, char *argv[]) int option_index = 0; static struct option long_options[] = { - {"norpc", 0, 0, 't'}, + {"online", 1, 0, 't'}, {"filesize", 1, 0, 'z'}, {"resdownscale", 1, 0, 'e'}, {"resnumevents", 1, 0, 'n'}, @@ -317,7 +317,7 @@ static int argsFromCL(TheArgs *my, int argc, char *argv[]) {"ignore", 0, 0, 'i'}, {0, 0, 0, 0} }; - i = getopt_long(argc, argv, "am:f:r:o:d:q:p:v:x:I:tz:e:n:h:w:tz:e:n:Hs:l:R:A:bEL:S:B:O:i", long_options, &option_index); + i = getopt_long(argc, argv, "am:f:r:o:d:q:p:v:x:I:t:z:e:n:h:w:tz:e:n:Hs:l:R:A:bEL:S:B:O:i", long_options, &option_index); if (i == -1) break; switch (i) { @@ -351,8 +351,8 @@ static int argsFromCL(TheArgs *my, int argc, char *argv[]) case 'I': my->evtId = strtoul(optarg, NULL, 0); break; - case 't': /* norpc - no arg */ - my->no_rpc = 1; + case 't': /* online: 0=off, 1=on */ + my->online = strtoul(optarg, NULL, 0); break; case 'z': /* from MBytes to Bytes */ my->maxFileSz = (1024 * 1024UL * strtoul(optarg, NULL, 0)); @@ -733,6 +733,7 @@ unsigned long getRunId(TheArgs *my) static void statsDump(TheArgs *theArgs, TheStats *my, int interval) { static unsigned long lastEC; + static unsigned long lastEE; static unsigned long lastTE; static unsigned long lastED; @@ -868,8 +869,8 @@ static void storeInfoStart(const char *n, time_t t, TheArgs *my) Param_storeInt(p, n, "ressizelimit", my->ressizelimit); } - if (my->no_rpc == 1) { - Param_storeInt(p, n, "rpc", my->no_rpc); + if (my->online == 1) { + Param_storeInt(p, n, "rpc", my->online); } if (my->write_data == 1) { Param_storeString(p, n, "sec_path", my->sec_path); @@ -1439,7 +1440,7 @@ static int rfio_openConnection(TheArgs *theArgs) fprintf(stderr, " evtbuild.c, rfio_fopen(): trying to open connection to Data Mover: %s\n", rfioBase); /* fRemote = rfio_fopen( rfioBase, "wb" ); */ - fRemote = rfio_fopen_gsidaq(rfioBase, "wb", 2, theArgs->rfioLustrePath, 1, 10, 1); + fRemote = rfio_fopen_gsidaq(rfioBase, "wb", 1, theArgs->rfioLustrePath, 1, 10, 1); if (fRemote == NULL) { syslog(LOG_ERR, "%s, %d: trying to open connection to Data Mover %s: %s", @@ -1525,7 +1526,7 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - if (theArgs->no_rpc) + if (theArgs->online == 0) syslog(LOG_WARNING, "DISABLE of online service"); else if (-1 == initOnline()) syslog(LOG_WARNING, "unable to initialize online service");