unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de>
Cc: Mathieu Othacehe <othacehe@gnu.org>, 59784@debbugs.gnu.org
Subject: bug#59784: [version 1.4.0rc1] Retrying a failed install fails
Date: Thu, 15 Dec 2022 00:50:21 +0100	[thread overview]
Message-ID: <87sfhhr1du.fsf@gnu.org> (raw)
In-Reply-To: <87h6xxpsil.fsf@pelzflorian.de> (pelzflorian@pelzflorian.de's message of "Wed, 14 Dec 2022 22:47:14 +0100")

[-- Attachment #1: Type: text/plain, Size: 156 bytes --]

Grrr, I’m really silly: we have the same problem (copying the database
before the daemon has been stopped) just a few lines above.

How about this:


[-- Attachment #2: Type: text/x-patch, Size: 2139 bytes --]

diff --git a/gnu/installer/final.scm b/gnu/installer/final.scm
index 044f79372b..360b34d8cb 100644
--- a/gnu/installer/final.scm
+++ b/gnu/installer/final.scm
@@ -1,6 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018, 2020 Mathieu Othacehe <m.othacehe@gmail.com>
-;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019, 2020, 2022 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -196,14 +196,15 @@ (define (assert-exit x)
              ;; the loaded cow-store locale files will prevent umounting.
              (install-locale locale)
 
-             ;; Save the database, so that it can be restored once the
-             ;; cow-store is umounted.
+             ;; Stop the daemon and save the database, so that it can be
+             ;; restored once the cow-store is umounted.
+             (stop-service 'guix-daemon)
              (copy-file database-file saved-database)
+
              (mount-cow-store (%installer-target-dir) backing-directory))
            (lambda ()
              ;; We need to drag the guix-daemon to the container MNT
              ;; namespace, so that it can operate on the cow-store.
-             (stop-service 'guix-daemon)
              (start-service 'guix-daemon (list (number->string (getpid))))
 
              (setvbuf (current-output-port) 'none)
@@ -213,10 +214,13 @@ (define (assert-exit x)
 
              (set! ret (run-command install-command #:tty? #t)))
            (lambda ()
-             ;; Restart guix-daemon so that it does no keep the MNT namespace
+             ;; Stop guix-daemon so that it does no keep the MNT namespace
              ;; alive.
-             (restart-service 'guix-daemon)
+             (stop-service 'guix-daemon)
+
+             ;; Restore the database and restart it.
              (copy-file saved-database database-file)
+             (start-service 'guix-daemon)
 
              ;; Finally umount the cow-store and exit the container.
              (unmount-cow-store (%installer-target-dir) backing-directory)

[-- Attachment #3: Type: text/plain, Size: 131 bytes --]


?

This time, I believe we only ever copy the database when we’re sure no
guix-daemon process is accessing it.

Ludo’.

  reply	other threads:[~2022-12-14 23:51 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02 17:52 bug#59784: [version 1.4.0rc1] Retrying a failed install fails pelzflorian (Florian Pelz)
2022-12-09  9:42 ` Ludovic Courtès
2022-12-09 11:11   ` Ludovic Courtès
2022-12-10  8:39   ` pelzflorian (Florian Pelz)
2022-12-13  9:40     ` Ludovic Courtès
2022-12-13  9:48       ` Ludovic Courtès
2022-12-13 22:22         ` pelzflorian (Florian Pelz)
2022-12-13 23:16           ` Ludovic Courtès
2022-12-14 13:36             ` pelzflorian (Florian Pelz)
2022-12-14 21:47               ` pelzflorian (Florian Pelz)
2022-12-14 23:50                 ` Ludovic Courtès [this message]
2022-12-15 17:46                   ` pelzflorian (Florian Pelz)
2022-12-15 20:44                     ` pelzflorian (Florian Pelz)
2022-12-16 16:57                       ` Ludovic Courtès
2022-12-16 20:28                         ` pelzflorian (Florian Pelz)
2022-12-17 11:01                           ` Ludovic Courtès
2022-12-17 19:36                             ` pelzflorian (Florian Pelz)
2022-12-17 16:15                         ` Ludovic Courtès
2022-12-17 19:27                           ` pelzflorian (Florian Pelz)
2022-12-17 21:30                             ` Ludovic Courtès
2022-12-18  0:23                               ` Ludovic Courtès
2022-12-16 13:55                 ` Maxime Devos
2022-12-16 20:17                   ` pelzflorian (Florian Pelz)
2022-12-18 16:41                 ` pelzflorian (Florian Pelz)
2022-12-12 12:07 ` pelzflorian (Florian Pelz)

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=87sfhhr1du.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=59784@debbugs.gnu.org \
    --cc=othacehe@gnu.org \
    --cc=pelzflorian@pelzflorian.de \
    /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).