From 78ff3961ca9fb012eaaca3d3af1e8186fe1827e7 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 29 Jan 2022 11:38:16 -0800 Subject: daemon-unix: Close log file in monitor process while waiting on child. Until now, the monitor process held its log file open while it waited for the child to exit, and then it reopened it after the child exited. Holding the log file open this way prevented log rotation from freeing disk space. This commit avoids the problem by closing the log file before waiting, then reopening it afterward. Signed-off-by: Ben Pfaff Reported-by: Antonin Bas VMware-BZ: #2743409 Signed-off-by: William Tu --- include/openvswitch/vlog.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/openvswitch') diff --git a/include/openvswitch/vlog.h b/include/openvswitch/vlog.h index 886fce5e0..e53ce6d81 100644 --- a/include/openvswitch/vlog.h +++ b/include/openvswitch/vlog.h @@ -131,7 +131,9 @@ void vlog_set_verbosity(const char *arg); /* Configuring log destinations. */ void vlog_set_pattern(enum vlog_destination, const char *pattern); +char *vlog_get_log_file(void); int vlog_set_log_file(const char *file_name); +void vlog_close_log_file(void); int vlog_reopen_log_file(void); #ifndef _WIN32 void vlog_change_owner_unix(uid_t, gid_t); -- cgit v1.2.1