Subject: Re: [bug#73494] [PATCH v6 2/3] services: cleanup: Bind mount /var/run to /run.

From: Ludovic Courtès <[email-masked]>
Date: Sat, 03 May 2025 17:47:11 +0200

Hello,

Hilton Chain <[email-masked]> writes:

> * gnu/system/file-systems.scm (%runtime-variable-data)
> (%runtime-variable-data/bind-mount): New variables.
> * gnu/system/file-systems.scm (%base-file-systems): Register
> %runtime-variable-data.
> * gnu/services.scm (cleanup-gexp): Bind mount /var/run to /run.  Remove now
> extraneous cleanups.
> * doc/guix.texi (File Systems): Document it.
>
> Change-Id: Ie462347935569acddfba68441cf58815a5087cff
> Modified-by: Maxim Cournoyer <[email-masked]>

[...]

> @@ -662,17 +667,17 @@ (define (cleanup-gexp _)
>                        "/lib/locale"))
>             (setlocale LC_CTYPE "en_US.utf8")
>             (delete-file-recursively "/tmp")
> -           (delete-file-recursively "/var/run")
> -           (delete-file-recursively "/run")
>  
>             ;; Note: The second argument to 'mkdir' is and'ed with umask,
>             ;; hence the 'chmod' calls.
>             (mkdir "/tmp" #o1777)
>             (chmod "/tmp" #o1777)
> -           (mkdir "/var/run" #o755)
> -           (chmod "/var/run" #o755)
> -           (mkdir "/run" #o755)
> -           (chmod "/var/run" #o755))))))
> +
> +           ;; XXX: It'd be cleaner if we could simply register
> +           ;; %runtime-variable-data/bind-mount in %base-file-systems, that
> +           ;; fails with: 'statfs-raw: No such file or directory' when
> +           ;; checking for "/run".
> +           (mount-file-system %runtime-variable-data/bind-mount #:root "/"))))))

Could you try to get a backtrace or something?

‘statfs-raw’ is the C primitive used by the statically-linked Guile in
the initrd, so before shepherd is spawned.  Normally, upon error, you
get a Guile prompt where you can type “,bt” for a backtrace.

Thanks for working on it!

Ludo’.