Skip to content

Commit 65a3b77

Browse files
committed
scripts(scripts/setup/termux_setup_dotnet): use SIGKILL and wait in termux_dotnet_kill
1 parent b6a49d9 commit 65a3b77

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

scripts/build/setup/termux_setup_dotnet.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,16 @@ termux_setup_dotnet() {
112112

113113
termux_dotnet_kill() {
114114
# when "dotnet build-server shutdown" is not enough
115+
# lingering processes inherit fd 5 (flock), blocking the next build
115116
local dotnet_process
116117
dotnet_process="$(pgrep -a dotnet)" || return 0
117118
echo "WARN: Dangling process, forcibly killing"
118119
echo "${dotnet_process}"
119-
pkill dotnet || :
120+
pkill -9 dotnet || :
121+
# wait for processes to exit so fd 5 (flock) is released
122+
local i
123+
for i in $(seq 1 10); do
124+
pgrep dotnet > /dev/null 2>&1 || break
125+
sleep 1
126+
done
120127
}

0 commit comments

Comments
 (0)