build: shepherd: Use autoload to lazily bind Shepherd modules.

Instead of imperative module-autoload! directives.

* gnu/build/shepherd.scm: Replace module-autoload! directives by autoload
arguments for define-module.
This commit is contained in:
Maxim Cournoyer 2021-07-27 23:24:23 -04:00
parent 6b9bebbb3d
commit 5b2b834269
No known key found for this signature in database
GPG Key ID: 1260E46482E63562
1 changed files with 6 additions and 8 deletions

View File

@ -24,6 +24,12 @@
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:use-module (ice-9 match)
;; XXX: Lazy-bind the Shepherd to avoid a compile-time dependency.
#:autoload (shepherd service) (fork+exec-command
read-pid-file
exec-command
%precious-signals)
#:autoload (shepherd system) (unblock-signals)
#:export (make-forkexec-constructor/container
fork+exec-command/container))
@ -92,14 +98,6 @@
(file-exists? (file-system-mapping-source mapping)))
mappings)))))
;; XXX: Lazy-bind the Shepherd to avoid a compile-time dependency.
(module-autoload! (current-module)
'(shepherd service)
'(fork+exec-command read-pid-file exec-command
%precious-signals))
(module-autoload! (current-module)
'(shepherd system) '(unblock-signals))
(define* (read-pid-file/container pid pid-file #:key (max-delay 5))
"Read PID-FILE in the container namespaces of PID, which exists in a
separate mount and PID name space. Return the \"outer\" PID. "