From efee4fe9b116348fcc0eb94a529650f8770143fb Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Fri, 29 Sep 2006 13:20:22 +0000 Subject: [PATCH] Added support for specifying the max log file size for the Generic Frontend Server. The size is given with option -r. --- NEWS | 3 +++ doc/gfs-options.xml | 10 +++++++++- doc/gfs-synopsis.xml | 3 ++- src/statserv.c | 12 ++++++++++-- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 0618561..f5bc3d1 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ +Added support for specifying the max log file size for the Generic +Frontend Server. The size is given with option -r. + --- 2.1.32 2006/09/21 Fix problem introduced in YAZ 2.1.28 WRT unix sockets in the ZOOM code. diff --git a/doc/gfs-options.xml b/doc/gfs-options.xml index 011c828..247c89c 100644 --- a/doc/gfs-options.xml +++ b/doc/gfs-options.xml @@ -1,5 +1,5 @@ @@ -155,6 +155,14 @@ + -r + size + + Maximum size of log file before rotation occurs, in kilobytes. + Default size is 1048576 k (=1 GB). + + + -d daemon diff --git a/doc/gfs-synopsis.xml b/doc/gfs-synopsis.xml index e8652d1..3fda880 100644 --- a/doc/gfs-synopsis.xml +++ b/doc/gfs-synopsis.xml @@ -1,5 +1,5 @@ @@ -21,6 +21,7 @@ + listener-spec diff --git a/src/statserv.c b/src/statserv.c index 5556cd1..42acb60 100644 --- a/src/statserv.c +++ b/src/statserv.c @@ -5,7 +5,7 @@ * NT threaded server code by * Chas Woodfield, Fretwell Downing Informatics. * - * $Id: statserv.c,v 1.43 2006-09-27 11:39:02 adam Exp $ + * $Id: statserv.c,v 1.44 2006-09-29 13:20:23 adam Exp $ */ /** @@ -1349,7 +1349,7 @@ int check_options(int argc, char **argv) } get_logbits(1); - while ((ret = options("1a:iszSTl:v:u:c:w:t:k:d:A:p:DC:f:m:", + while ((ret = options("1a:iszSTl:v:u:c:w:t:k:d:A:p:DC:f:m:r:", argv, argc, &arg)) != -2) { switch (ret) @@ -1459,6 +1459,14 @@ int check_options(int argc, char **argv) case 'D': control_block.background = 1; break; + case 'r': + if (!arg || !(r = atoi(arg))) + { + fprintf(stderr, "%s: Specify positive size for -r.\n", me); + return(1); + } + yaz_log_init_max_size(r * 1024); + break; default: fprintf(stderr, "Usage: %s [ -a -v " " -l -u -c -t " -- 1.7.10.4