summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
authorKaushal M <kaushal@gluster.com>2011-10-14 10:33:18 +0530
committerVijay Bellur <vijay@gluster.com>2011-10-28 05:03:18 -0700
commit1252cc90da6156945c3636c1a2b5f702bc14fb2d (patch)
treeeaece100ea604fa6e82e3b4545c7dfe0d04c0f65 /libglusterfs/src
parent1e6780efd7320250a213eca25ee85bbf217825c4 (diff)
glusterd: fix '.cmd_log_history'file handle leak on SIGHUP
Closes the .cmd_log_history file and reopens it to prevent leakage of file handles. Change-Id: I1c846ccf9a0c1c90c9209f26a1c5332d3dd94ffd BUG: 3678 Reviewed-on: http://review.gluster.com/584 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com>
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/logging.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c
index 159a21b1f61..5b9c1fc4f74 100644
--- a/libglusterfs/src/logging.c
+++ b/libglusterfs/src/logging.c
@@ -607,7 +607,11 @@ gf_cmd_log_init (const char *filename)
" error\n");
return -1;
}
-
+ /* close and reopen cmdlogfile for log rotate*/
+ if (cmdlogfile) {
+ fclose (cmdlogfile);
+ cmdlogfile = NULL;
+ }
cmdlogfile = fopen (cmd_log_filename, "a");
if (!cmdlogfile){
gf_log ("glusterd", GF_LOG_CRITICAL,
and rebalance/remove brick statusKaushal M2013-09-193-19/+44 * cli: check for null in is_server_debug_xlator()Ravishankar N2013-09-091-0/+2 * gluster/CLI: crash upon executing "peer status" commandSantosh Kumar Pradhan2013-09-091-0/+9 * cli: set min-op-version and max-op-version for getspecJeff Darcy2013-07-111-0/+34 * glusterd: Add a cmd for getting uuid of local nodeKrishnan Parthasarathi2013-06-182-0/+157 * glusterd: Backport of vme table changes from masterKaushal M2013-06-051-6/+6 * Better mechanism to handle memory accountingVijay Bellur2013-03-031-0/+2 * glusterd: "volume heal info" doesn't report output properlyVenkatesh Somyajulu2013-02-041-18/+31 * glusterfs : Moved option files, and statedumps from /tmpAvra Sengupta2013-01-292-0/+6 * debug/trace: save the recent fops received in the event-historyRaghavendra Bhat2013-01-172-3/+70 * cli: output xml in pretty formatKaushal M2013-01-162-59/+53 * Fix format security errors with hardening build flagsNiels de Vos2013-01-161-2/+2 * cli: Fix task-id xml compilationKaushal M2013-01-081-0/+2 * core: remove all the 'inner' functions in codebaseAmar Tumballi2012-12-192-40/+60 * glusterd, cli: Task id's for async tasksKaushal M2012-12-192-45/+269 * cli: Making the op-ret check for gluster peer probe --xml more robust.v3.4.0qa6Avra Sengupta2012-12-191-2/+2 * cli: Fixing the xml output in failure cases for gluster peer detachAvra Sengupta2012-12-191-2/+4<