services: shepherd: Add workaround for 0.5.0 in containers.
* gnu/services/shepherd.scm (%containerized-shepherd-service): New service. * gnu/system.scm (essential-services): Use it when CONTAINER? is true.
This commit is contained in:
parent
6f03b08089
commit
a56c4eb8f4
|
@ -59,6 +59,7 @@
|
||||||
%default-modules
|
%default-modules
|
||||||
|
|
||||||
shepherd-service-file
|
shepherd-service-file
|
||||||
|
%containerized-shepherd-service
|
||||||
|
|
||||||
shepherd-service-lookup-procedure
|
shepherd-service-lookup-procedure
|
||||||
shepherd-service-back-edges
|
shepherd-service-back-edges
|
||||||
|
@ -327,6 +328,21 @@ symbols provided/required by a service."
|
||||||
(lambda (service)
|
(lambda (service)
|
||||||
(vhash-foldq* cons '() service edges)))
|
(vhash-foldq* cons '() service edges)))
|
||||||
|
|
||||||
|
(define %containerized-shepherd-service
|
||||||
|
;; XXX: This service works around a bug in the Shepherd 0.5.0: shepherd
|
||||||
|
;; calls reboot(2) (via 'disable-reboot-on-ctrl-alt-del') when it starts,
|
||||||
|
;; but in a container that fails with EINVAL. This was fixed in Shepherd
|
||||||
|
;; commit 92e806bac1abaeeaf5d60f0ab50d1ae85ba6a62f.
|
||||||
|
(simple-service 'containerized-shepherd
|
||||||
|
shepherd-root-service-type
|
||||||
|
(list (shepherd-service
|
||||||
|
(provision '(containerized-shepherd))
|
||||||
|
(start #~(lambda ()
|
||||||
|
(set! (@@ (shepherd)
|
||||||
|
disable-reboot-on-ctrl-alt-del)
|
||||||
|
(const #t))
|
||||||
|
#t))))))
|
||||||
|
|
||||||
(define (shepherd-service-upgrade live target)
|
(define (shepherd-service-upgrade live target)
|
||||||
"Return two values: the subset of LIVE (a list of <live-service>) that needs
|
"Return two values: the subset of LIVE (a list of <live-service>) that needs
|
||||||
to be unloaded, and the subset of TARGET (a list of <shepherd-service>) that
|
to be unloaded, and the subset of TARGET (a list of <shepherd-service>) that
|
||||||
|
|
|
@ -501,7 +501,7 @@ a container or that of a \"bare metal\" system."
|
||||||
;; Add the firmware service, unless we are building for a
|
;; Add the firmware service, unless we are building for a
|
||||||
;; container.
|
;; container.
|
||||||
(if container?
|
(if container?
|
||||||
'()
|
(list %containerized-shepherd-service)
|
||||||
(list %linux-bare-metal-service
|
(list %linux-bare-metal-service
|
||||||
(service firmware-service-type
|
(service firmware-service-type
|
||||||
(operating-system-firmware os))))))))
|
(operating-system-firmware os))))))))
|
||||||
|
|
Loading…
Reference in New Issue