diff options
author | Erich Eckner <git@eckner.net> | 2020-04-19 00:37:30 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2020-04-19 00:37:30 +0200 |
commit | ffaecceaa0ae889c9bfb2d3c876578c622d782b0 (patch) | |
tree | d67a214cddb0941734984b9e9afe3f1c75c5c710 | |
parent | c5c659a4940037a5c1820c32256cfa054cc5f0ee (diff) | |
download | kamikaze-fsck-ffaecceaa0ae889c9bfb2d3c876578c622d782b0.tar.xz |
kamikaze-fsck: kill -9 after 10 seconds
-rwxr-xr-x | kamikaze-fsck | 3 |
1 files changed, 3 insertions, 0 deletions
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" |