From: Pierre Langlois <pierre.langlois@gmx.com>
To: Arun Isaac <arunisaac@systemreboot.net>
Cc: "Ludovic Courtès" <ludo@gnu.org>,
"Bruno Victal" <mirai@makinata.eu>,
61627@debbugs.gnu.org,
"Pierre Langlois" <pierre.langlois@gmx.com>
Subject: bug#61627: Cannot start a container built with `guix system container --network'.
Date: Sun, 26 Mar 2023 14:14:38 +0100 [thread overview]
Message-ID: <87fs9rhcv3.fsf@gmx.com> (raw)
In-Reply-To: <87mt403j7s.fsf@systemreboot.net>
[-- Attachment #1.1: Type: text/plain, Size: 599 bytes --]
Hi Arun and Bruno,
Arun Isaac <arunisaac@systemreboot.net> writes:
>> I'm inclined to keep it in %network-configuration-files just to be
>> safe.
>
> I agree. I don't really understand the implications of removing
> /etc/hosts from %network-configuration-files. I would err on the side of
> caution and leave it there for now.
That sounds very sensible.
>
> @Pierre: Could you make a patch of the fix you suggested earlier
> (removing hosts-service-type when the --network flag is provided) and
> push it? Thank you!
Sounds good! Just testing the following patch and will push it in a
minute.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 519 bytes --]
[-- Attachment #2: 0001-linux-container-Remove-hosts-service-type-when-netwo.patch --]
[-- Type: text/x-patch, Size: 1909 bytes --]
From 42fbe62d52a82d1003c3d7039d3c4a46806c5cee Mon Sep 17 00:00:00 2001
Message-Id: <42fbe62d52a82d1003c3d7039d3c4a46806c5cee.1679836531.git.pierre.langlois@gmx.com>
From: Pierre Langlois <pierre.langlois@gmx.com>
Date: Sun, 26 Mar 2023 13:55:14 +0100
Subject: [PATCH] linux-container: Remove hosts-service-type when network is
shared.
Fixes <https://issues.guix.gnu.org/61627>.
* gnu/system/linux-container.scm (container-essential-services): When
shared-network? is true, remove the hosts-service-type service kind.
---
gnu/system/linux-container.scm | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm
index c2fd55d48e..409386a84f 100644
--- a/gnu/system/linux-container.scm
+++ b/gnu/system/linux-container.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2020 Google LLC
;;; Copyright © 2022 Ricardo Wurmus <rekado@elephly.net>
+;;; Copyright © 2023 Pierre Langlois <pierre.langlois@gmx.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -49,9 +50,12 @@ (define* (container-essential-services os #:key shared-network?)
(define base
(remove (lambda (service)
(memq (service-kind service)
- (list (service-kind %linux-bare-metal-service)
- firmware-service-type
- system-service-type)))
+ (cons* (service-kind %linux-bare-metal-service)
+ firmware-service-type
+ system-service-type
+ (if shared-network?
+ (list hosts-service-type)
+ '()))))
(operating-system-default-essential-services os)))
(cons (service system-service-type
--
2.39.2
[-- Attachment #3: Type: text/plain, Size: 18 bytes --]
Thanks,
Pierre
next prev parent reply other threads:[~2023-03-26 13:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-19 14:58 bug#61627: Cannot start a container built with `guix system container --network' Pierre Langlois
2023-02-19 15:29 ` Pierre Langlois
2023-03-20 17:46 ` Bruno Victal
2023-03-21 12:53 ` Arun Isaac
2023-03-23 12:50 ` Bruno Victal
2023-03-25 16:10 ` Arun Isaac
2023-03-26 13:14 ` Pierre Langlois [this message]
2023-03-26 13:41 ` Pierre Langlois
2023-03-26 22:20 ` Arun Isaac
2023-02-26 20:54 ` Nicolò Balzarotti
2023-03-19 19:26 ` Arun Isaac
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87fs9rhcv3.fsf@gmx.com \
--to=pierre.langlois@gmx.com \
--cc=61627@debbugs.gnu.org \
--cc=arunisaac@systemreboot.net \
--cc=ludo@gnu.org \
--cc=mirai@makinata.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.