[PATCH] services: Create /var/log upon activation

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Christopher Baines
Owner
unassigned
Submitted by
Christopher Baines
Severity
normal

Debbugs page

Christopher Baines wrote 8 years ago
(address . guix-patches@gnu.org)
20170223082057.6850-1-mail@cbaines.net
When launching a container created with guix system container, the
attempt to create /var/log/wtmp would fail, as /var/log did not exist.

* gnu/services.scm (activation-script): Create /var/log
---
gnu/services.scm | 1 +
1 file changed, 1 insertion(+)

Toggle diff (14 lines)
diff --git a/gnu/services.scm b/gnu/services.scm
index 6ac4f1322..15a0f2f89 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -345,6 +345,7 @@ ACTIVATION-SCRIPT-TYPE."
;; Same for 'wtmp', which is populated by mingetty et
;; al.
+ (if (not (file-exists? "/var/log")) (mkdir "/var/log"))
(close-port (open-file "/var/log/wtmp" "a0"))
;; Set up /run/current-system. Among other things this
--
2.11.1
Ludovic Courtès wrote 8 years ago
(name . Christopher Baines)(address . mail@cbaines.net)(address . 25850-done@debbugs.gnu.org)
87o9x99rok.fsf@gnu.org
Christopher Baines <mail@cbaines.net> skribis:

Toggle quote (18 lines)
> When launching a container created with guix system container, the
> attempt to create /var/log/wtmp would fail, as /var/log did not exist.
>
> * gnu/services.scm (activation-script): Create /var/log
> ---
> gnu/services.scm | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/gnu/services.scm b/gnu/services.scm
> index 6ac4f1322..15a0f2f89 100644
> --- a/gnu/services.scm
> +++ b/gnu/services.scm
> @@ -345,6 +345,7 @@ ACTIVATION-SCRIPT-TYPE."
>
> ;; Same for 'wtmp', which is populated by mingetty et
> ;; al.
> + (if (not (file-exists? "/var/log")) (mkdir "/var/log"))

I changed that to ‘mkdir-p’ and applied, thanks!

Ludo’.
Closed
?
Your comment

This issue is archived.

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

To respond to this issue using the mumi CLI, first switch to it
mumi current 25850
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
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help