summaryrefslogtreecommitdiff
path: root/gnu/system/linux-container.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2025-06-04 17:01:23 +0200
committerLudovic Courtès <ludo@gnu.org>2025-06-04 17:01:23 +0200
commited5988f0d2cf14e3cc35a32e6ad91d7cbf535e2f (patch)
treedbb9f97a3831ca3aa38239583e7fb892f4c534fb /gnu/system/linux-container.scm
parent1ed9af7586abcdd978d6baef071caa698ecafc7d (diff)
linux-container: ‘containerized-operating-system’ provides ‘loopback’ service.
Fixes #420. Previously, in systems produced by ‘guix system container’, the ‘loopback’ Shepherd service would fail to start with EEXIST, because the “lo” interface already exists in the container. This commit provides a fake ‘loopback’ Shepherd service that does nothing. * gnu/system/linux-container.scm (dummy-networking-service-type): Change to honor its configuration value. (containerized-operating-system)[services-to-drop]: Add ‘static-networking-service-type’ in the non-‘shared-network?’ case. [services-to-add]: Add ‘dummy-networking-service-type’ for loopback in the non-‘shared-network?’ case. Reported-by: Antonio Carlos Padoan Junior <acpadoanjr@yahoo.com.br> Change-Id: I326b5f3b5e08f67b6613c186497c44b1e887b02e
Diffstat (limited to 'gnu/system/linux-container.scm')
-rw-r--r--gnu/system/linux-container.scm19
1 files changed, 11 insertions, 8 deletions
diff --git a/gnu/system/linux-container.scm b/gnu/system/linux-container.scm
index 8e208d3a704..e9be2c9d8a4 100644
--- a/gnu/system/linux-container.scm
+++ b/gnu/system/linux-container.scm
@@ -78,12 +78,13 @@ from OS that are needed on the bare metal and not in a container."
78(define dummy-networking-service-type 78(define dummy-networking-service-type
79 (shepherd-service-type 79 (shepherd-service-type
80 'dummy-networking 80 'dummy-networking
81 (const (shepherd-service 81 (lambda (provision)
82 (documentation "Provide loopback and networking without actually 82 (shepherd-service
83 (documentation "Provide loopback and networking without actually
83doing anything.") 84doing anything.")
84 (provision '(loopback networking)) 85 (provision provision)
85 (start #~(const #t)))) 86 (start #~(const #t))))
86 #f 87 '(loopback networking)
87 (description "Provide loopback and networking without actually doing 88 (description "Provide loopback and networking without actually doing
88anything. This service is used by guest systems running in containers, where 89anything. This service is used by guest systems running in containers, where
89networking support is provided by the host."))) 90networking support is provided by the host.")))
@@ -135,7 +136,7 @@ containerized OS. EXTRA-FILE-SYSTEMS is a list of file systems to add to OS."
135 dhcp-client-service-type 136 dhcp-client-service-type
136 network-manager-service-type 137 network-manager-service-type
137 connman-service-type) 138 connman-service-type)
138 (list)))) 139 (list static-networking-service-type)))) ;loopback
139 140
140 (define services-to-add 141 (define services-to-add
141 ;; Many Guix services depend on a 'networking' shepherd 142 ;; Many Guix services depend on a 'networking' shepherd
@@ -143,8 +144,10 @@ containerized OS. EXTRA-FILE-SYSTEMS is a list of file systems to add to OS."
143 ;; service when we are sure that networking is already set up 144 ;; service when we are sure that networking is already set up
144 ;; in the host and can be used. That prevents double setup. 145 ;; in the host and can be used. That prevents double setup.
145 (if shared-network? 146 (if shared-network?
146 (list (service dummy-networking-service-type)) 147 (list (service dummy-networking-service-type
147 '())) 148 '(loopback networking)))
149 (list (service dummy-networking-service-type
150 '(loopback)))))
148 151
149 (define os-with-base-essential-services 152 (define os-with-base-essential-services
150 (operating-system 153 (operating-system