mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
services: shepherd: Load each service file in a fresh module.
Fixes <https://issues.guix.gnu.org/67649>. * gnu/home/services/shepherd.scm (home-shepherd-configuration-file)[config]: Define ‘make-user-module’. Call ‘load’ in ‘save-module-excursion’. * gnu/services/shepherd.scm (shepherd-configuration-file): Likewise. Reported-by: Attila Lendvai <attila@lendvai.name> Change-Id: I7df11c81b5bbbf2b24a8daa02502a000e0826fe0
This commit is contained in:
parent
2b052fe3c0
commit
6f9d844d2e
2 changed files with 25 additions and 2 deletions
|
@ -77,7 +77,19 @@ as shepherd package."
|
|||
(use-modules (srfi srfi-34)
|
||||
(system repl error-handling))
|
||||
|
||||
(register-services (map load '#$files))
|
||||
(define (make-user-module)
|
||||
;; Copied from (shepherd support), where it's private.
|
||||
(let ((m (make-fresh-user-module)))
|
||||
(module-use! m (resolve-interface '(shepherd service)))
|
||||
m))
|
||||
|
||||
(register-services
|
||||
(map (lambda (file)
|
||||
(save-module-excursion
|
||||
(lambda ()
|
||||
(set-current-module (make-user-module))
|
||||
(load file))))
|
||||
'#$files))
|
||||
|
||||
#$@(if daemonize?
|
||||
`((action 'root 'daemonize))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue