Skip to content

Commit

Permalink
add util to kill active tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
marco-foscato committed Sep 11, 2024
1 parent 39036b9 commit 801f92f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/kill_active_tasks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
#
# Kills all the tasks that hold lock files.
#
for actFile in $(ls /tmp/activeConfSearchOrRefine* /tmp/activeDFTTask* /tmp/activeXTBTask* 2> /dev/null)
do
pid="$(awk -F':|)' '{print $2}' "$actFile" )"
for spid in $(pgrep -P "$pid")
do
kill -9 "$spid"
done
lockFile="$(awk '{print $5}' "$actFile")"
rm -f "$lockFile"
rm -f "$actFile"
kill -9 "$pid"
done

0 comments on commit 801f92f

Please sign in to comment.