[umount] Avoid SIGPIPE

- collect output from umount process, and then ignore it
This commit is contained in:
Adriaan de Groot 2020-04-21 16:13:19 +02:00
parent e51fbdc851
commit c59af8881c

View File

@ -98,7 +98,9 @@ def run():
lst.sort(key=lambda x: x[1], reverse=True)
for device, mount_point in lst:
subprocess.check_call(["umount", "-lv", mount_point])
# On success, no output; if the command fails, its output is
# in the exception object.
subprocess.check_output(["umount", "-lv", mount_point], stderr=subprocess.STDOUT)
os.rmdir(root_mount_point)