From 4f2b31c705345c20b2fa5fad734f9fb6157425bb Mon Sep 17 00:00:00 2001 From: 2Shirt <2xShirt@gmail.com> Date: Fri, 3 Jan 2020 01:14:06 -0700 Subject: [PATCH] Avoid crash while stopping ddrescue * Killall is needed because of sudo --- scripts/wk/hw/ddrescue.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/wk/hw/ddrescue.py b/scripts/wk/hw/ddrescue.py index 722fcdcf..b67babc6 100644 --- a/scripts/wk/hw/ddrescue.py +++ b/scripts/wk/hw/ddrescue.py @@ -1675,14 +1675,15 @@ def run_ddrescue(state, block_pair, pass_name, settings, dry_run=True): except KeyboardInterrupt: # Wait a bit to let ddrescue exit safely warning_message = 'Aborted' - proc.wait(timeout=10) - proc.terminate() + std.sleep(2) + exe.run_program(['sudo', 'killall', 'ddrescue'], check=False) break except subprocess.TimeoutExpired: # Continue to next loop to update panes pass else: # Done + std.sleep(1) break # Update progress