From 3a19dfa4192d9c8e207be43ef65441cbb8f025f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Tue, 18 Jan 2011 17:31:49 +0000 Subject: [PATCH] Update documentation and cleanup due to debugging. --- org.glite.lb.logger/doc/glite-lb-interlogd.8 | 6 +----- org.glite.lb.logger/doc/glite-lb-logd.8 | 6 +----- org.glite.lb.logger/src/interlogd.c | 8 -------- org.glite.lb.server/doc/glite-lb-bkserverd.8 | 2 +- org.glite.lb.server/src/bkserverd.c | 12 +----------- org.glite.lb.server/src/db_supp.c | 2 -- org.glite.lb.server/src/index.c.T | 2 -- org.glite.lb.server/src/lb_http.c | 3 --- org.glite.lb.server/src/notif_match.c | 2 -- org.glite.lb.server/src/ws_lb4agu.c | 6 ++---- org.glite.lb.server/src/ws_query.c | 9 +++------ org.glite.lbjp-common.server-bones/src/srvbones.c | 20 -------------------- 12 files changed, 9 insertions(+), 69 deletions(-) diff --git a/org.glite.lb.logger/doc/glite-lb-interlogd.8 b/org.glite.lb.logger/doc/glite-lb-interlogd.8 index 87cf2e3..1728b09 100644 --- a/org.glite.lb.logger/doc/glite-lb-interlogd.8 +++ b/org.glite.lb.logger/doc/glite-lb-interlogd.8 @@ -65,7 +65,7 @@ environment variable. .TP .B "-d\fR,\fP --debug" -Don't run as daemon (do not fork and put itself into background). +Don't run as daemon (do not fork and put itself into background). Additional diagnostics are not enabled, they can be configured through log4c instead. .TP .BI \-i " FILE" "\fR,\fP --pidfile " FILE @@ -111,10 +111,6 @@ Listen for events sent by glite-lb-logd at the UNIX socket .I PATH. .TP -.B "-v\fR,\fP --verbose" -Print extensive debug output. - -.TP .B "-V\fR,\fP --version" Print version and exit. diff --git a/org.glite.lb.logger/doc/glite-lb-logd.8 b/org.glite.lb.logger/doc/glite-lb-logd.8 index 6c6590a..cb58116 100644 --- a/org.glite.lb.logger/doc/glite-lb-logd.8 +++ b/org.glite.lb.logger/doc/glite-lb-logd.8 @@ -38,11 +38,7 @@ environment variable. .TP .B "-d\fR,\fP --debug" -Don't run as daemon, print additional diagnostics. - -.TP -.B "-v\fR,\fP --verbose" -Print extensive debug output. +Don't run as daemon. Additional diagnostics are not enabled, they can be configured through log4c instead. .TP .BI \-p " NUM" "\fR,\fP --port " NUM diff --git a/org.glite.lb.logger/src/interlogd.c b/org.glite.lb.logger/src/interlogd.c index 08b2728..52172cd 100644 --- a/org.glite.lb.logger/src/interlogd.c +++ b/org.glite.lb.logger/src/interlogd.c @@ -74,7 +74,6 @@ static void usage (int status) " -h, --help display this help and exit\n" " -V, --version output version information and exit\n" " -d, --debug do not run as daemon\n" - " -v, --verbose print extensive debug output\n" " -f, --file-prefix path and prefix for event files\n" " -c, --cert location of server certificate\n" " -k, --key location of server private key\n" @@ -105,7 +104,6 @@ static void usage (int status) /* Option flags and variables */ static int debug; -static int verbose = 0; char *file_prefix = DEFAULT_PREFIX; int bs_only = 0; int lazy_close = 1; @@ -132,7 +130,6 @@ static struct option const long_options[] = { {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'}, - {"verbose", no_argument, 0, 'v'}, {"debug", no_argument, 0, 'd'}, {"file-prefix", required_argument, 0, 'f'}, {"cert", required_argument, 0, 'c'}, @@ -176,7 +173,6 @@ decode_switches (int argc, char **argv) "f:" /* file prefix */ "h" /* help */ "V" /* version */ - "v" /* verbose */ "c:" /* certificate */ "k:" /* key */ "C:" /* CA dir */ @@ -209,10 +205,6 @@ decode_switches (int argc, char **argv) printf ("interlogger %s\n", VERSION); exit (0); - case 'v': - verbose = 1; - break; - case 'h': usage (0); diff --git a/org.glite.lb.server/doc/glite-lb-bkserverd.8 b/org.glite.lb.server/doc/glite-lb-bkserverd.8 index af1ce96..fb35156 100644 --- a/org.glite.lb.server/doc/glite-lb-bkserverd.8 +++ b/org.glite.lb.server/doc/glite-lb-bkserverd.8 @@ -73,7 +73,7 @@ environment variable. .TP .B "-d\fR,\fP --debug" -Don't run as daemon, print additional diagnostics. +Don't run as daemon. Additional diagnostics are not enabled, they can be configured through log4c instead. .TP .B "-r\fR,\fP --rgmaexport" diff --git a/org.glite.lb.server/src/bkserverd.c b/org.glite.lb.server/src/bkserverd.c index 7393550..efff832 100644 --- a/org.glite.lb.server/src/bkserverd.c +++ b/org.glite.lb.server/src/bkserverd.c @@ -128,10 +128,6 @@ extern void _start (void), etext (void); #define GLITE_LBPROXY_SOCK_PREFIX "/tmp/lb_proxy_" #endif -#ifndef dprintf -#define dprintf(x) { if (debug) printf x; } -#endif - #define sizofa(a) (sizeof(a)/sizeof((a)[0])) #define SERVICE_PROXY DB_PROXY_JOB @@ -220,7 +216,6 @@ static struct option opts[] = { {"notif-il-fprefix", 1, NULL, 'Y'}, {"count-statistics", 1, NULL, 'T'}, {"request-timeout", 1, NULL, 't'}, - {"silent", 0, NULL, 'z' }, #ifdef LB_PERF {"perf-sink", 1, NULL, 'K'}, #endif @@ -263,7 +258,7 @@ static void usage(char *me) "\t-w, --wsport\t port to serve the web services requests\n" #endif /* GLITE_LB_SERVER_WITH_WS */ "\t-m, --mysql\t database connect string\n" - "\t-d, --debug\t don't run as daemon, additional diagnostics\n" + "\t-d, --debug\t don't run as daemon\n" "\t-r, --rgmaexport write state info to RGMA interface\n" "\t-n, --noauth\t don't check user identity with result owner\n" "\t-s, --slaves\t number of slave servers to fork\n" @@ -284,7 +279,6 @@ static void usage(char *me) "\t--count-statistics=1\t count certain statistics on jobs\n" "\t =2\t ... and allow anonymous access\n" "\t-t, --request-timeout\t request timeout for one client\n" - "\t--silent\t don't print diagnostic, even if -d is on\n" #ifdef LB_PERF "\t-K, --perf-sink\t where to sink events\n" #endif @@ -407,7 +401,6 @@ int main(int argc, char *argv[]) edg_wll_GssStatus gss_code; struct timeval to; int request_timeout = REQUEST_TIMEOUT; - int silent = 0; char socket_path_prefix[PATH_MAX] = GLITE_LBPROXY_SOCK_PREFIX; @@ -447,7 +440,6 @@ int main(int argc, char *argv[]) case 'w': free(ws_port); ws_port = strdup(optarg); break; #endif /* GLITE_LB_SERVER_WITH_WS */ case 'd': debug = 1; break; - case 'z': silent = 1; break; case 'r': rgma_export = 1; break; case 'm': dbstring = optarg; break; case 'n': noAuth = 1; break; @@ -881,8 +873,6 @@ int main(int argc, char *argv[]) setpgid(0, getpid()); } - if (silent) debug = 0; - glite_srvbones_set_param(GLITE_SBPARAM_SLAVES_COUNT, slaves); glite_srvbones_set_param(GLITE_SBPARAM_SLAVE_OVERLOAD, SLAVE_OVERLOAD); glite_srvbones_set_param(GLITE_SBPARAM_SLAVE_CONNS_MAX, SLAVE_CONNS_MAX); diff --git a/org.glite.lb.server/src/db_supp.c b/org.glite.lb.server/src/db_supp.c index cf49b8c..977c34d 100644 --- a/org.glite.lb.server/src/db_supp.c +++ b/org.glite.lb.server/src/db_supp.c @@ -24,8 +24,6 @@ limitations under the License. #include "glite/lb/context-int.h" #include "glite/lbu/log.h" -extern int debug; // declared and set in bkserver.c - int edg_wll_SetErrorDB(edg_wll_Context ctx) { int code; diff --git a/org.glite.lb.server/src/index.c.T b/org.glite.lb.server/src/index.c.T index 46057b9..81ed411 100644 --- a/org.glite.lb.server/src/index.c.T +++ b/org.glite.lb.server/src/index.c.T @@ -27,8 +27,6 @@ limitations under the License. #include "db_supp.h" #include "index.h" -extern int debug; - #define const_len(c) (sizeof((c))-1) static int parse_indices(edg_wll_Context ctx,char **keys,char ***column_names,const char **built_in_indices,edg_wll_QueryRec *** index_out,char ***keys_out); diff --git a/org.glite.lb.server/src/lb_http.c b/org.glite.lb.server/src/lb_http.c index b60f81a..917bf25 100644 --- a/org.glite.lb.server/src/lb_http.c +++ b/org.glite.lb.server/src/lb_http.c @@ -31,9 +31,6 @@ limitations under the License. #include "lb_http.h" #include "lb_proto.h" -extern int debug; -#define dprintf(x) if (debug) printf x - int edg_wll_AcceptHTTP(edg_wll_Context ctx, char **body, char **resp, char ***hdrOut, char **bodyOut, int *httpErr) { diff --git a/org.glite.lb.server/src/notif_match.c b/org.glite.lb.server/src/notif_match.c index 3afeafb..f516592 100644 --- a/org.glite.lb.server/src/notif_match.c +++ b/org.glite.lb.server/src/notif_match.c @@ -40,8 +40,6 @@ limitations under the License. static int notif_match_conditions(edg_wll_Context,const edg_wll_JobStat *,const edg_wll_JobStat *,const char *); static int notif_check_acl(edg_wll_Context,const edg_wll_JobStat *,const char *, int *); -extern int debug; - int edg_wll_NotifExpired(edg_wll_Context,const char *); int edg_wll_NotifMatch(edg_wll_Context ctx, const edg_wll_JobStat *oldstat, const edg_wll_JobStat *stat) diff --git a/org.glite.lb.server/src/ws_lb4agu.c b/org.glite.lb.server/src/ws_lb4agu.c index 22ac007..154e374 100644 --- a/org.glite.lb.server/src/ws_lb4agu.c +++ b/org.glite.lb.server/src/ws_lb4agu.c @@ -31,8 +31,6 @@ limitations under the License. #include "ws_typeref.h" #include "jobstat.h" -extern int debug; - #define LB_GLUE_STATE_PREFIX "urn:org.glite.lb" /** @@ -75,7 +73,7 @@ SOAP_FMAC5 int SOAP_FMAC6 __lb4agu__GetActivityStatus( } flags = 0; - if (debug) { + if (glite_common_log_get_priority(LOG_CATEGORY_LB_SERVER_REQUEST) >= LOG_PRIORITY_DEBUG) { char *cjobid = NULL, *cflags = NULL; cjobid = edg_wlc_JobIdUnparse(j); @@ -411,7 +409,7 @@ SOAP_FMAC5 int SOAP_FMAC6 __lb4agu__GetActivityInfo( } flags = EDG_WLL_STAT_CLASSADS | EDG_WLL_STAT_CHILDREN; - if (debug) { + if (glite_common_log_get_priority(LOG_CATEGORY_LB_SERVER_REQUEST) >= LOG_PRIORITY_DEBUG) { char *cjobid = NULL, *cflags = NULL; cjobid = edg_wlc_JobIdUnparse(j); diff --git a/org.glite.lb.server/src/ws_query.c b/org.glite.lb.server/src/ws_query.c index d392836..1c8d73e 100644 --- a/org.glite.lb.server/src/ws_query.c +++ b/org.glite.lb.server/src/ws_query.c @@ -45,9 +45,6 @@ limitations under the License. #define __lb__QueryEvents __ns1__QueryEvents #endif -extern int debug; -#define dprintf(x) if (debug) printf x - static void freeQueryRecsExt(edg_wll_QueryRec **qr); static void freeJobIds(edg_wlc_JobId *jobs); static void freeJobStats(edg_wll_JobStat *stats); @@ -91,7 +88,7 @@ SOAP_FMAC5 int SOAP_FMAC6 __lb__JobStatus( edg_wll_SoapToJobStatFlags(in->flags, &flags); - if (debug) { + if (glite_common_log_get_priority(LOG_CATEGORY_LB_SERVER_REQUEST) >= LOG_PRIORITY_DEBUG) { char *cjobid = NULL, *cflags = NULL; cjobid = edg_wlc_JobIdUnparse(j); @@ -148,7 +145,7 @@ SOAP_FMAC5 int SOAP_FMAC6 __lb__QueryJobs( } edg_wll_SoapToJobStatFlags(in->flags, &flags); - if (debug) { + if (glite_common_log_get_priority(LOG_CATEGORY_LB_SERVER_REQUEST) >= LOG_PRIORITY_DEBUG) { char *message = NULL; if (edg_wll_QueryJobsRequestToXML(ctx, @@ -244,7 +241,7 @@ SOAP_FMAC5 int SOAP_FMAC6 __lb__QueryEvents( goto cleanup; } - if (debug) { + if (glite_common_log_get_priority(LOG_CATEGORY_LB_SERVER_REQUEST) >= LOG_PRIORITY_DEBUG) { char *message = NULL; if (edg_wll_QueryEventsRequestToXML(ctx, diff --git a/org.glite.lbjp-common.server-bones/src/srvbones.c b/org.glite.lbjp-common.server-bones/src/srvbones.c index 20cb3eb..d872903 100644 --- a/org.glite.lbjp-common.server-bones/src/srvbones.c +++ b/org.glite.lbjp-common.server-bones/src/srvbones.c @@ -47,16 +47,11 @@ limitations under the License. #define NEW_CLIENT_DURATION 10 /* how long a client is considered new, i.e. busy connection is not closed to serve other clients */ -#ifndef dprintf -#define dprintf(x) { if (debug) printf x; } -#endif - #ifdef LB_PROF extern void _start (void), etext (void); #endif static int running = 0; -static int debug = 0; static volatile int die = 0, child_died = 0; static unsigned long clnt_dispatched = 0, @@ -135,7 +130,6 @@ int glite_srvbones_run( services = service_table; services_ct = table_sz; - debug = dbg; setlinebuf(stdout); setlinebuf(stderr); @@ -341,20 +335,6 @@ static int dispatchit(int sock_slave, int sock, int sidx) alen = sizeof(a); if ( (conn = accept(sock, (struct sockaddr *)&a, &alen)) < 0 ) { - //TODO: check debug according to previous version -#if 0 - if (debug) - { - perror("accept()"); - return 1; - } - else - { - syslog(LOG_ERR, "accept(): %m"); - sleep(5); - return -1; - } -#endif glite_common_log(set_log_category, LOG_PRIORITY_WARN, "accept()"); sleep(5); return -1; -- 1.8.2.3