GNU bug report logs - #51548
[PATCH] services: Create /run and /var/run on activation.

Previous Next

Package: guix-patches;

Reported by: Tom Fitzhenry <tom <at> tom-fitzhenry.me.uk>

Date: Mon, 1 Nov 2021 11:41:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 51548 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#51548; Package guix-patches. (Mon, 01 Nov 2021 11:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tom Fitzhenry <tom <at> tom-fitzhenry.me.uk>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 01 Nov 2021 11:41:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tom Fitzhenry <tom <at> tom-fitzhenry.me.uk>
To: guix-patches <at> gnu.org
Subject: [PATCH] services: Create /run and /var/run on activation.
Date: Mon, 1 Nov 2021 22:39:48 +1100
This is needed as part of being able to boot with just /boot, /guix and 
/var/guix, per https://issues.guix.gnu.org/51547.

Without this patch, activation-on-boot fails due to the inability to 
open /var/run/utmpx and symlink /run/current-system.

This is similar to what activation-script does with /var/log/.

* gnu/services.scm (activation-script): Create /run/ and /var/run/.
---
 gnu/services.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gnu/services.scm b/gnu/services.scm
index 1655218f2d..f60d7dc4c3 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -620,6 +620,7 @@ (define actions
                       ;; Make sure the user accounting database 
exists.  If it
                       ;; does not exist, 'setutxent' does not create 
it and
                       ;; thus there is no accounting at all.
+                      (mkdir-p "/var/run")
                       (close-port (open-file "/var/run/utmpx" "a0"))

                       ;; Same for 'wtmp', which is populated by 
mingetty et
@@ -630,6 +631,7 @@ (define actions
                       ;; Set up /run/current-system.  Among other 
things this
                       ;; sets up locales, which the activation snippets
                       ;; executed below may expect.
+                      (mkdir-p "/run")
                       (activate-current-system)

                       ;; Run the services' activation snippets.
-- 
2.33.1




Information forwarded to guix-patches <at> gnu.org:
bug#51548; Package guix-patches. (Thu, 04 Nov 2021 07:01:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Tom Fitzhenry <tom <at> tom-fitzhenry.me.uk>
To: guix-patches <at> gnu.org
Subject: Re: [PATCH] services: Create /run and /var/run on activation.
Date: Thu, 4 Nov 2021 18:00:18 +1100
Having thought about this patch some more, I think it can be better done.

On 1/11/21 22:39, Tom Fitzhenry wrote:
>                         ;; thus there is no accounting at all.
> +                      (mkdir-p "/var/run")

This line will create /var/run if it doesn't exist during activation. 
This is safe, but there is already code that creates /var/run : 
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/build/install.scm?id=63c356fe13f0c7cc560a1f9aeec4926422c22137#n120 
. This runs on installation.

By adding this line, this responsibility is split across two parts of 
the code base: installation and activation. This could cause confusion.

If, as this patch intends, we want to be able to boot from just /boot, 
/gnu and /var/guix, perhaps we should move 
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/build/install.scm?id=63c356fe13f0c7cc560a1f9aeec4926422c22137#n120 
(and surrounding code) from running at install-time to running at 
activation-time.




This bug report was last modified 2 years and 173 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.