From 0181b5fd094211601ea6dec3208ef7c8be7ee958 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 26 Jun 2018 10:03:29 +0200 Subject: [PATCH 2/2] ply-logger: Truncate log files instead of appending ply_logger_open_file() is only called from ply_terminal_session_open_log() which in turn is only used for /var/log/boot.log. In the past boot.log used to contain only info from the current boot. I believe that getting back to this behavior is better for 2 reasons: 1) Given that it does not contain timestamps it is hard to make sense of the contents if info from multiple boots is concatenated. 2) It is not log-rotated, so if we append it will grow unlimited over time. Signed-off-by: Hans de Goede --- src/libply/ply-logger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libply/ply-logger.c b/src/libply/ply-logger.c index 1b56ea8..496b9a5 100644 --- a/src/libply/ply-logger.c +++ b/src/libply/ply-logger.c @@ -40,7 +40,7 @@ #include "ply-list.h" #ifndef PLY_LOGGER_OPEN_FLAGS -#define PLY_LOGGER_OPEN_FLAGS (O_WRONLY | O_APPEND | O_CREAT | O_NOFOLLOW | O_CLOEXEC) +#define PLY_LOGGER_OPEN_FLAGS (O_WRONLY | O_TRUNC | O_CREAT | O_NOFOLLOW | O_CLOEXEC) #endif #ifndef PLY_LOGGER_MAX_INJECTION_SIZE -- 2.17.1