From 3c4a363c78283a93b4498e84759c4fc7f2049055 Mon Sep 17 00:00:00 2001 From: Oliver Gorwits Date: Sat, 24 Jan 2015 21:01:47 +0000 Subject: [PATCH] 12 MB threshold for rename versus truncate --- Netdisco/bin/netdisco-daemon | 5 +++-- Netdisco/bin/netdisco-web | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Netdisco/bin/netdisco-daemon b/Netdisco/bin/netdisco-daemon index 70a746d9..a21e554b 100755 --- a/Netdisco/bin/netdisco-daemon +++ b/Netdisco/bin/netdisco-daemon @@ -155,8 +155,9 @@ sub rotate_logs { } # if the log file's about 10M then the race condition in copy/truncate - # has a low probability. if the file's larger, then we rename and kill - if ((-s $log_file) > (11 * 1024768)) { + # has a low risk of data loss. if the file's larger, then we rename and + # kill. + if ((-s $log_file) > (12 * 1024768)) { rename $log_file, $log_file .'.1'; signal_child('TERM', $child); $child = fork_and_start(@_); diff --git a/Netdisco/bin/netdisco-web b/Netdisco/bin/netdisco-web index dc93030b..d7aea73e 100755 --- a/Netdisco/bin/netdisco-web +++ b/Netdisco/bin/netdisco-web @@ -169,8 +169,9 @@ sub rotate_logs { } # if the log file's about 10M then the race condition in copy/truncate - # has a low probability. if the file's larger, then we rename and kill - if ((-s $log_file) > (15 * 1024768)) { + # has a low risk of data loss. if the file's larger, then we rename and + # kill. + if ((-s $log_file) > (12 * 1024768)) { rename $log_file, $log_file .'.1'; signal_child('HUP', $child); }