From 127dd2ada6e06abf0761ea647f7ae18a5de78e4f Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Sun, 29 Aug 2010 06:43:58 +0000 Subject: gluster{d,fs,fsd}: add logrorate functionality to SIGHUP Signed-off-by: Amar Tumballi Signed-off-by: Vijay Bellur BUG: 1472 (SIGHUP should do 'logrotate') URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1472 --- glusterfsd/src/glusterfsd.c | 16 +++++++++++++--- glusterfsd/src/glusterfsd.h | 4 +--- 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'glusterfsd') diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index 7c818028062..2a542f63c60 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -669,14 +669,24 @@ reincarnate (int signum) ctx = glusterfs_ctx_get (); cmd_args = &ctx->cmd_args; - gf_log ("glusterfsd", GF_LOG_NORMAL, - "Reloading volfile ..."); - if (!cmd_args->volfile_server) + if (cmd_args->volfile_server) { + gf_log ("glusterfsd", GF_LOG_NORMAL, + "Fetching the volume file from server..."); + ret = glusterfs_volfile_fetch (ctx); + } else { + gf_log ("glusterfsd", GF_LOG_NORMAL, + "Reloading volfile ..."); ret = glusterfs_volumes_init (ctx); + } + if (ret < 0) gf_log ("glusterfsd", GF_LOG_ERROR, "volume initialization failed."); + + /* Also, SIGHUP should do logroate */ + gf_log_logrotate (1); + return; } diff --git a/glusterfsd/src/glusterfsd.h b/glusterfsd/src/glusterfsd.h index a082b0e4b7f..c0789b6d202 100644 --- a/glusterfsd/src/glusterfsd.h +++ b/glusterfsd/src/glusterfsd.h @@ -77,11 +77,9 @@ enum argp_option_keys { ARGP_BRICK_PORT_KEY = 152, }; -/* Moved here from fetch-spec.h */ -FILE *fetch_spec (glusterfs_ctx_t *ctx); - int glusterfs_mgmt_pmap_signout (glusterfs_ctx_t *ctx); int glusterfs_mgmt_pmap_signin (glusterfs_ctx_t *ctx); +int glusterfs_volfile_fetch (glusterfs_ctx_t *ctx); #endif /* __GLUSTERFSD_H__ */ -- cgit