From c59af8881cfe787a185c0b01682e7f166dd54aff Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 21 Apr 2020 16:13:19 +0200 Subject: [PATCH] [umount] Avoid SIGPIPE - collect output from umount process, and then ignore it --- src/modules/umount/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/umount/main.py b/src/modules/umount/main.py index a337c481a..454222c5c 100644 --- a/src/modules/umount/main.py +++ b/src/modules/umount/main.py @@ -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)