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)) + + ;; And restart guix-daemon. (start-service 'guix-daemon) ;; Finally umount the cow-store and exit the container.