From 72d09a09da1e22909038a9ac00c16d58cf2e8b26 Mon Sep 17 00:00:00 2001 From: Gianluca Zuccarelli Date: Wed, 28 May 2025 17:36:39 +0100 Subject: [PATCH] schutzbot: fix update github status f42 There seems to be a change in behaviour from Fedora 41 to Fedora 42. When a script is executed remotely a non-interactive session is created. However, the user session with noTTY in Fedora F42 is picked up by the `who`, `w` & `users` commands. Since we run a remote script that checks for logged in users with the `who` command, the `update_github_status.sh` script blocks and creates an endless loop. This happens because the session only closes once the remote script has finished executing. The fix is a bit ugly, but we can filter this session out by checking for user sessions that don't have a terminal device `?`. --- schutzbot/update_github_status.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schutzbot/update_github_status.sh b/schutzbot/update_github_status.sh index df4e39f8..11633cfd 100755 --- a/schutzbot/update_github_status.sh +++ b/schutzbot/update_github_status.sh @@ -1,7 +1,7 @@ #!/bin/bash # if a user is logged in to the runner, wait until they're done -while (( $(who -s | wc -l) > 0 )); do +while (( $(who -u | grep -v '?' | wc -l) > 0 )); do echo "Waiting for user(s) to log off" sleep 30 done