--silent
authorAleš Křenek <ljocha@ics.muni.cz>
Tue, 23 May 2006 14:11:53 +0000 (14:11 +0000)
committerAleš Křenek <ljocha@ics.muni.cz>
Tue, 23 May 2006 14:11:53 +0000 (14:11 +0000)
org.glite.lb.server/src/bkserverd.c
org.glite.lb.server/src/lb_http.c
org.glite.lb.server/src/lock.c

index 3a4acc3..8b80c7d 100644 (file)
@@ -165,13 +165,14 @@ static struct option opts[] = {
        {"notif-il-fprefix",    1, NULL,        'Y'},
        {"count-statistics",    1, NULL,        'T'},
        {"request-timeout",     1, NULL,        't'},
+       {"silent",      0, NULL, 'z' },
        {NULL,0,NULL,0}
 };
 
 #ifdef GLITE_LB_SERVER_WITH_WS
-static const char *get_opt_string = "a:c:k:C:V:p:w:drm:ns:l:L:N:i:S:D:X:Y:T:t:J:j";
+static const char *get_opt_string = "a:c:k:C:V:p:w:drm:ns:l:L:N:i:S:D:X:Y:T:t:J:jz";
 #else
-static const char *get_opt_string = "a:c:k:C:V:p:drm:ns:l:L:N:i:S:D:X:Y:T:t:J:j";
+static const char *get_opt_string = "a:c:k:C:V:p:drm:ns:l:L:N:i:S:D:X:Y:T:t:J:jz";
 #endif /* GLITE_LB_SERVER_WITH_WS */
 
 static void usage(char *me) 
@@ -208,6 +209,7 @@ static void usage(char *me)
                "\t--notif-il-fprefix\t file prefix for notifications\n"
                "\t--count-statistics=1\t count certain statistics on jobs\n"
                "\t                  =2\t ... and allow anonymous access\n"
+               "\t--silent\t don't print diagnostic, even if -d is on\n"
        ,me);
 }
 
@@ -288,6 +290,7 @@ int main(int argc, char *argv[])
        edg_wll_GssStatus       gss_code;
        struct timeval          to;
        int                     request_timeout = REQUEST_TIMEOUT;
+       int     silent = 0;
 
 
 
@@ -332,6 +335,7 @@ 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;
@@ -575,6 +579,7 @@ a.sin_addr.s_addr = INADDR_ANY;
                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);
index efe0c41..038d679 100644 (file)
@@ -13,7 +13,8 @@
 #include "lb_http.h"
 #include "lb_proto.h"
 
-#define dprintf(x) printf x
+extern int debug;
+#define dprintf(x) if (debug) printf x
 
 
 int edg_wll_ServerHTTP(edg_wll_Context ctx)
index 70a817f..bb73529 100644 (file)
@@ -7,6 +7,7 @@
 #include "glite/lb/context-int.h"
 #include "lock.h"
 
+extern int debug;
 
 int edg_wll_LockUnlockJob(const edg_wll_Context ctx,const edg_wlc_JobId job,int lock)
 {
@@ -21,7 +22,7 @@ int edg_wll_LockUnlockJob(const edg_wll_Context ctx,const edg_wlc_JobId job,int
        for (i=0; i<sizeof b64 && b64[i] != un[1]; i++);
        n += i<<6;
 
-       fprintf(stderr,"[%d] semop(%d,%d) \n",getpid(),n % ctx->semaphores,lock);
+       if (debug) fprintf(stderr,"[%d] semop(%d,%d) \n",getpid(),n % ctx->semaphores,lock);
 
        s.sem_num = n % ctx->semaphores;
        s.sem_op = lock;