summaryrefslogtreecommitdiffstats
path: root/glusterfsd
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
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')
-rw-r--r--glusterfsd/src/glusterfsd.c16
-rw-r--r--glusterfsd/src/glusterfsd.h4
2 files changed, 14 insertions, 6 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;
}
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__ */