summaryrefslogtreecommitdiffstats
path: root/glusterfsd/src/glusterfsd.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-08-29 06:43:58 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-08-29 11:37:22 -0700
commit127dd2ada6e06abf0761ea647f7ae18a5de78e4f (patch)
tree3c933f5ce238e3d621f9b22d3f9103831d9c255f /glusterfsd/src/glusterfsd.c
parent157560b6dce9cf790e8405ce895d80f4efab1539 (diff)
gluster{d,fs,fsd}: add logrorate functionality to SIGHUP
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1472 (SIGHUP should do 'logrotate') URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1472
Diffstat (limited to 'glusterfsd/src/glusterfsd.c')
-rw-r--r--glusterfsd/src/glusterfsd.c16
1 files changed, 13 insertions, 3 deletions
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;
}