[PATCH] services: Create /run and /var/run on activation.

  • Open
  • quality assurance status badge
Details
One participant
  • Tom Fitzhenry
Owner
unassigned
Submitted by
Tom Fitzhenry
Severity
normal
T
T
Tom Fitzhenry wrote on 1 Nov 2021 12:39
(address . guix-patches@gnu.org)
9da03290-b031-fec0-11fe-a3f591b38f61@tom-fitzhenry.me.uk
This is needed as part of being able to boot with just /boot, /guix and

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(+)

Toggle diff (26 lines)
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
T
T
Tom Fitzhenry wrote on 4 Nov 2021 08:00
(address . guix-patches@gnu.org)
02ac6d0b-6229-0b52-6e97-bc5adee0ff37@tom-fitzhenry.me.uk
Having thought about this patch some more, I think it can be better done.

On 1/11/21 22:39, Tom Fitzhenry wrote:
Toggle quote (3 lines)
>                        ;; 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 :
. 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
(and surrounding code) from running at install-time to running at
activation-time.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 51548@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 51548
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch