From dedfeaca08469bd99294d22c536f44a2cfe47b30 Mon Sep 17 00:00:00 2001 From: Bryce Chidester Date: Mon, 11 Jul 2022 09:54:41 -0700 Subject: [PATCH 1/2] [universal-stdout-logs] Use tail -F to follow rotated log files I appreciate this mod for keeping an eye on nginx logs and such. The lsio/swag rotates those log files daily, and unfortunately that causes this mod to stop working. I propose using tail's `-F` (a shortcut for `--follow=name --retry`) instead of `-f` so that this mod will continue tailing the newly-rotated log file. --- root/etc/services.d/stdout-logs/run | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/root/etc/services.d/stdout-logs/run b/root/etc/services.d/stdout-logs/run index dbd3461..da9e156 100644 --- a/root/etc/services.d/stdout-logs/run +++ b/root/etc/services.d/stdout-logs/run @@ -2,5 +2,5 @@ TAIL_LOGS=$(echo "$LOGS_TO_STDOUT" | sed 's#|# -f #g') -echo "Executing: tail -f $TAIL_LOGS" -tail -f $TAIL_LOGS +echo "Executing: tail -F $TAIL_LOGS" +tail -F $TAIL_LOGS From b75231080892d7495612f9770bba22a5c4d15aec Mon Sep 17 00:00:00 2001 From: Bryce Chidester Date: Mon, 11 Jul 2022 10:57:17 -0700 Subject: [PATCH 2/2] Remove extraneous -f between tail file arguments tail requires the -f/-F option to be passed just once, not between every log file. --- root/etc/services.d/stdout-logs/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root/etc/services.d/stdout-logs/run b/root/etc/services.d/stdout-logs/run index da9e156..91df555 100644 --- a/root/etc/services.d/stdout-logs/run +++ b/root/etc/services.d/stdout-logs/run @@ -1,6 +1,6 @@ #!/usr/bin/with-contenv bash -TAIL_LOGS=$(echo "$LOGS_TO_STDOUT" | sed 's#|# -f #g') +TAIL_LOGS=$(echo "$LOGS_TO_STDOUT" | sed 's#|# #g') echo "Executing: tail -F $TAIL_LOGS" tail -F $TAIL_LOGS