summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-10-04 22:40:26 +0200
committerLudovic Courtès <ludo@gnu.org>2020-10-05 10:41:59 +0200
commitb68d4106518abed20ba308831b65dcc69bf120a5 (patch)
treeb20b8d4542ec2363cb47c9deb86788e440f1757c /guix
parent5aa7d764be7018ef3e5bef34857970c103c6abaf (diff)
environment: Turn "lo" up in network-less containers.
This is a followup to 0f53c801b91919380a924b402d1ff822bb1dc6ea. * guix/scripts/environment.scm (launch-environment/container): Add call to 'set-network-interface-up'. * tests/guix-environment-container.sh: Add test.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/environment.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index 9698111cd2..085f11a9d4 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -34,6 +34,7 @@
#:use-module (guix scripts build)
#:use-module (gnu build linux-container)
#:use-module (gnu build accounts)
+ #:use-module ((guix build syscalls) #:select (set-network-interface-up))
#:use-module (gnu system linux-container)
#:use-module (gnu system file-systems)
#:use-module (gnu packages)
@@ -554,7 +555,10 @@ WHILE-LIST."
;; to resolve "localhost".
(call-with-output-file "/etc/hosts"
(lambda (port)
- (display "127.0.0.1 localhost\n" port))))
+ (display "127.0.0.1 localhost\n" port)))
+
+ ;; Allow local AF_INET communications.
+ (set-network-interface-up "lo"))
;; For convenience, start in the user's current working
;; directory or, if unmapped, the home directory.