container: Gracefully handle failure to set up user namespaces.
* gnu/build/linux-container.scm (run-container): Exit when the parent process doesn't say 'ready.
This commit is contained in:
parent
552ffa021c
commit
4c14d4eaa7
|
@ -214,7 +214,8 @@ host user identifiers to map into the user namespace."
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(close out)
|
(close out)
|
||||||
;; Wait for parent to set things up.
|
;; Wait for parent to set things up.
|
||||||
(read in)
|
(match (read in)
|
||||||
|
('ready
|
||||||
(close in)
|
(close in)
|
||||||
(purify-environment)
|
(purify-environment)
|
||||||
(when (memq 'mnt namespaces)
|
(when (memq 'mnt namespaces)
|
||||||
|
@ -222,7 +223,9 @@ host user identifiers to map into the user namespace."
|
||||||
#:mount-/proc? (memq 'pid namespaces)
|
#:mount-/proc? (memq 'pid namespaces)
|
||||||
#:mount-/sys? (memq 'net namespaces)))
|
#:mount-/sys? (memq 'net namespaces)))
|
||||||
;; TODO: Manage capabilities.
|
;; TODO: Manage capabilities.
|
||||||
(thunk))))
|
(thunk))
|
||||||
|
(_ ;parent died or something
|
||||||
|
(primitive-exit 2))))))
|
||||||
(pid
|
(pid
|
||||||
(when (memq 'user namespaces)
|
(when (memq 'user namespaces)
|
||||||
(initialize-user-namespace pid host-uids))
|
(initialize-user-namespace pid host-uids))
|
||||||
|
|
Loading…
Reference in New Issue