aboutsummaryrefslogtreecommitdiff
path: root/gnu/services
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-02-05 13:23:09 +0100
committerLudovic Courtès <ludo@gnu.org>2016-02-05 14:01:46 +0100
commit234ea8a71c70747d883c0634dcd56e243845d832 (patch)
treef6eb5e4797216c23fb7a6d9fe66e12d092ad3198 /gnu/services
parent081bd3bd29c8af228c237a178c171fcdf05425cf (diff)
downloadguix-234ea8a71c70747d883c0634dcd56e243845d832.tar
guix-234ea8a71c70747d883c0634dcd56e243845d832.tar.gz
service: shepherd: All of the config file is in 'call-with-error-handling'.
* gnu/services/shepherd.scm (shepherd-configuration-file)[config]: Wrap all the body in 'call-with-error-handling'.
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/shepherd.scm43
1 files changed, 22 insertions, 21 deletions
diff --git a/gnu/services/shepherd.scm b/gnu/services/shepherd.scm
index 207501cb1a..5d829e4c38 100644
--- a/gnu/services/shepherd.scm
+++ b/gnu/services/shepherd.scm
@@ -237,29 +237,30 @@ stored."
(use-modules (srfi srfi-34)
(system repl error-handling))
- ;; Arrange to spawn a REPL if loading one of FILES fails. This is
- ;; better than a kernel panic.
+ ;; Arrange to spawn a REPL if something goes wrong. This is better
+ ;; than a kernel panic.
(call-with-error-handling
(lambda ()
- (apply register-services (map primitive-load '#$files))))
-
- ;; guix-daemon 0.6 aborts if 'PATH' is undefined, so work around it.
- (setenv "PATH" "/run/current-system/profile/bin")
-
- (format #t "starting services...~%")
- (for-each (lambda (service)
- ;; In the Shepherd 0.3 the 'start' method can raise
- ;; '&action-runtime-error' if it fails, so protect
- ;; against it. (XXX: 'action-runtime-error?' is not
- ;; exported is 0.3, hence 'service-error?'.)
- (guard (c ((service-error? c)
- (format (current-error-port)
- "failed to start service '~a'~%"
- service)))
- (start service)))
- '#$(append-map shepherd-service-provision
- (filter shepherd-service-auto-start?
- services)))))
+ (apply register-services (map primitive-load '#$files))
+
+ ;; guix-daemon 0.6 aborts if 'PATH' is undefined, so work around
+ ;; it.
+ (setenv "PATH" "/run/current-system/profile/bin")
+
+ (format #t "starting services...~%")
+ (for-each (lambda (service)
+ ;; In the Shepherd 0.3 the 'start' method can raise
+ ;; '&action-runtime-error' if it fails, so protect
+ ;; against it. (XXX: 'action-runtime-error?' is not
+ ;; exported is 0.3, hence 'service-error?'.)
+ (guard (c ((service-error? c)
+ (format (current-error-port)
+ "failed to start service '~a'~%"
+ service)))
+ (start service)))
+ '#$(append-map shepherd-service-provision
+ (filter shepherd-service-auto-start?
+ services)))))))
(gexp->file "shepherd.conf" config)))