From ffaecceaa0ae889c9bfb2d3c876578c622d782b0 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sun, 19 Apr 2020 00:37:30 +0200 Subject: kamikaze-fsck: kill -9 after 10 seconds --- kamikaze-fsck | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kamikaze-fsck b/kamikaze-fsck index 7b40e99..1eb3e4e 100755 --- a/kamikaze-fsck +++ b/kamikaze-fsck @@ -56,6 +56,9 @@ while [ -f "${tmp_dir}/faulty-inode" ]; do start=$(date +%s) pkill -xf "e2fsck -f -y $1 -E no_optimize_extents,fixes_only -C 0" while pgrep -xf "e2fsck -f -y $1 -E no_optimize_extents,fixes_only -C 0" >/dev/null; do + if [ $(($(date +%s)-start)) -gt 10 ]; then + pkill -9 -xf "e2fsck -f -y $1 -E no_optimize_extents,fixes_only -C 0" + fi sleep 1 >&2 echo "running for $(($(date +%s)-start))" pkill -xf "e2fsck -f -y $1 -E no_optimize_extents,fixes_only -C 0" -- cgit v1.2.3-70-g09d2