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 `?`.
This commit is contained in:
parent
15b4aa01f9
commit
72d09a09da
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue