From f25dfda6ee814846e9df7e37867277e0e9aa12e3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Tue, 23 May 2006 14:23:29 +0000 Subject: [PATCH] --silent --- org.glite.lb.proxy/src/lbproxy.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/org.glite.lb.proxy/src/lbproxy.c b/org.glite.lb.proxy/src/lbproxy.c index 4f209c9..2d8cfaa 100644 --- a/org.glite.lb.proxy/src/lbproxy.c +++ b/org.glite.lb.proxy/src/lbproxy.c @@ -83,6 +83,7 @@ static struct option opts[] = { {"port", 1, NULL, 'p'}, {"con-queue", 1, NULL, 'c'}, {"debug", 0, NULL, 'd'}, + {"silent", 0, NULL, 'z'}, {"mysql", 1, NULL, 'm'}, {"slaves", 1, NULL, 's'}, {"semaphores", 1, NULL, 'l'}, @@ -92,7 +93,7 @@ static struct option opts[] = { {NULL,0,NULL,0} }; -static const char *get_opt_string = "p:c:dm:s:l:i:X:Y:"; +static const char *get_opt_string = "p:c:dm:s:l:i:X:Y:z"; static void usage(char *me) { @@ -106,6 +107,7 @@ static void usage(char *me) "\t-i, --pidfile\t file to store master pid\n" "\t--proxy-il-sock\t socket to send events to\n" "\t--proxy-il-fprefix\t file prefix for events\n" + "\t--silent\t don't print diagnostic, even if -d is on\n" ,me); } @@ -154,6 +156,7 @@ int main(int argc, char *argv[]) key_t semkey; edg_wll_Context ctx; struct timeval to; + int silent = 0; @@ -166,6 +169,7 @@ int main(int argc, char *argv[]) case 'p': strcpy(socket_path_prefix, optarg); break; case 'c': con_queue = atoi(optarg); break; case 'd': debug = 1; break; + case 'z': silent = 1; break; case 'm': dbstring = optarg; break; case 's': slaves = atoi(optarg); break; case 'l': semaphores = atoi(optarg); break; @@ -303,6 +307,7 @@ int main(int argc, char *argv[]) openlog(name, LOG_PID, LOG_DAEMON); } else { 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); @@ -359,7 +364,7 @@ int handle_conn(int conn, struct timeval *timeout, void *data) struct timeval conn_start, now; if ( !(ctx = (edg_wll_Context) calloc(1, sizeof(*ctx))) ) { - fprintf(stderr, "Couldn't create context"); + dprintf(("Couldn't create context")); return -1; } cdata->ctx = ctx; -- 1.8.2.3