Avoid crash while stopping ddrescue

* Killall is needed because of sudo
This commit is contained in:
2Shirt 2020-01-03 01:14:06 -07:00
parent 2b18da7244
commit 4f2b31c705
Signed by: 2Shirt
GPG key ID: 152FAC923B0E132C

View file

@ -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