From d2467fba9a52dde1bfafb85cfb6806d84a9ae8e9 Mon Sep 17 00:00:00 2001 From: Tristan Donkers Date: Sat, 15 Aug 2015 02:39:47 +1000 Subject: [PATCH] Add retry to tail, for cases where server rolls own log. --- init/msm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init/msm b/init/msm index b0f9bed..81f7722 100755 --- a/init/msm +++ b/init/msm @@ -826,7 +826,7 @@ server_log_get_line() { RETURN="${BASH_REMATCH[1]}" return 0 fi - done < <(as_user "${SERVER_USERNAME[$1]}" "tail --pid=$$ --follow --lines=20 --sleep-interval=0.1 \"${SERVER_LOG_PATH[$1]}\"") + done < <(as_user "${SERVER_USERNAME[$1]}" "tail --pid=$$ --follow=name --retry --lines=20 --sleep-interval=0.1 \"${SERVER_LOG_PATH[$1]}\"") } # The same as server_log_get_line, but prints a dot instead of the log line @@ -865,7 +865,7 @@ server_log_dots_for_lines() { return 0 fi fi - done < <(as_user "${SERVER_USERNAME[$1]}" "tail --pid=$$ --follow --lines=100 --sleep-interval=0.1 \"${SERVER_LOG_PATH[$1]}\"") + done < <(as_user "${SERVER_USERNAME[$1]}" "tail --pid=$$ --follow=name --retry --lines=100 --sleep-interval=0.1 \"${SERVER_LOG_PATH[$1]}\"") } # Sends as string to a server for execution @@ -3150,7 +3150,7 @@ command_server_cmdlog() { echo "Now watching logs (press Ctrl+C to exit):" echo "..." server_eval "$1" "${*:2}" - as_user "${SERVER_USERNAME[$1]}" "tail --pid=$$ --follow --lines=5 --sleep-interval=0.1 ${SERVER_LOG_PATH[$1]}" + as_user "${SERVER_USERNAME[$1]}" "tail --pid=$$ --follow=name --retry --lines=5 --sleep-interval=0.1 ${SERVER_LOG_PATH[$1]}" else error_exit SERVER_STOPPED "Server \"${SERVER_NAME[$1]}\" is not running." fi