From f8e0f4df2b06d4257c8b7a6f0f2d4086969ca6fa Mon Sep 17 00:00:00 2001 From: Carl Johnsen Date: Thu, 12 Mar 2026 11:22:40 +0100 Subject: [PATCH] Linux should use helper class for calling scripts, not another implementation of the same functionality --- proprietary/DiskImage/Disk/Linux.cs | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/proprietary/DiskImage/Disk/Linux.cs b/proprietary/DiskImage/Disk/Linux.cs index 5f2fa8f0c..7d8229be9 100644 --- a/proprietary/DiskImage/Disk/Linux.cs +++ b/proprietary/DiskImage/Disk/Linux.cs @@ -152,27 +152,11 @@ namespace Duplicati.Proprietary.DiskImage.Disk bool allSucceeded = true; foreach (var mountPoint in mountPoints) { - var psi = new ProcessStartInfo + var (ExitCode, Output, Error) = await ProcessRunner.RunProcessAsync("umount", $"\"{mountPoint}\"", 30_000, cancellationToken); + + if (ExitCode != 0) { - FileName = "umount", - Arguments = $"\"{mountPoint}\"", - RedirectStandardOutput = true, - RedirectStandardError = true, - UseShellExecute = false, - CreateNoWindow = true - }; - - using var process = new Process { StartInfo = psi }; - process.Start(); - - string output = await process.StandardOutput.ReadToEndAsync(cancellationToken); - string error = await process.StandardError.ReadToEndAsync(cancellationToken); - - await process.WaitForExitAsync(cancellationToken); - - if (process.ExitCode != 0) - { - Duplicati.Library.Logging.Log.WriteWarningMessage(LOGTAG, "autounmount", null, $"Failed to unmount {mountPoint}: {error}"); + Duplicati.Library.Logging.Log.WriteWarningMessage(LOGTAG, "autounmount", null, $"Failed to unmount {mountPoint}: {Error}"); allSucceeded = false; } else