|
From: | Maxime Devos |
Subject: | bug#59784: [version 1.4.0rc1] Retrying a failed install fails |
Date: | Fri, 16 Dec 2022 14:55:30 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 |
On 14-12-2022 22:47, pelzflorian (Florian Pelz) wrote:
fsyncing the database had no effect. (In addition to Ludo’s 'stop-service', I had done fsync.patch diff --git a/gnu/installer/final.scm b/gnu/installer/final.scm index ef487805f0..13deffef85 100644 --- a/gnu/installer/final.scm +++ b/gnu/installer/final.scm @@ -217,8 +217,16 @@ (define (assert-exit x) ;; alive. (stop-service 'guix-daemon)- ;; Restore the database and restart it.+ ;; Restore the database. (copy-file saved-database database-file) + + ;; Sync it to the filesystem. + (let* ((flags O_RDONLY) + (fd (open database-file flags))) + (fsync fd) + (close fd)) +
So, I'm nominally 'on hiatus', but I noticed this mail, and noticed you copied a file (and fsync'ed it), but forgot to fsync the directory it was copied to -- from what I've read (but I don't recall the source), fsyncing the contents of the file isn't enough, you also need to fsync the directory such that the new file entry is in the directory after crashing.
Greetings, Maxime.
OpenPGP_0x49E3EE22191725EE.asc
Description: OpenPGP public key
OpenPGP_signature
Description: OpenPGP digital signature
[Prev in Thread] | Current Thread | [Next in Thread] |