unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 71402@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#71402] [PATCH] services: Never throw when stopping mount-may-fail file systems.
Date: Thu,  6 Jun 2024 23:27:48 +0200	[thread overview]
Message-ID: <559a95a6e1df354eb1415fa78163a8d3f009c61a.1717709187.git.ludo@gnu.org> (raw)

This is a followup to 7c27bd115b14afd142da7684cc349369965f9eab.

* gnu/services/base.scm (file-system-shepherd-service): Catch
'system-error from ‘umount’ call when FILE-SYSTEM is marked as
mount-may-fail.

Change-Id: I2234f8da320b43089f4ee058cad8608ce9c078f8
---
 gnu/services/base.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Hi!

File systems marked as mount-may-fail could throw when stopped
(when the file system hadn't actually been mount).  This was mostly
harmless, but it should be ignored as well.

Thoughts?

Ludo'.

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 2d6b0f00e02..c7a14c7ed43 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -448,7 +448,11 @@ (define (file-system-shepherd-service file-system)
                       ;; Make sure PID 1 doesn't keep TARGET busy.
                       (chdir "/")
 
-                      (umount #$target)
+                      #$(if (file-system-mount-may-fail? file-system)
+                            #~(catch 'system-error
+                                (lambda () (umount #$target))
+                                (const #f))
+                            #~(umount #$target))
                       #f))
 
             ;; We need additional modules.

base-commit: 40c6f708393885a2d28f847350e8f47beb11e745
-- 
2.45.1





             reply	other threads:[~2024-06-06 21:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-06 21:27 Ludovic Courtès [this message]
2024-06-26 22:22 ` bug#71402: [PATCH] services: Never throw when stopping mount-may-fail file systems Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=559a95a6e1df354eb1415fa78163a8d3f009c61a.1717709187.git.ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=71402@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).