services: herd: Make %shepherd-socket-file a parameter and export it.
* gnu/services/herd.scm (%shepherd-socket-file): Make it an exported parameter. (open-connection): Adapt.
This commit is contained in:
parent
4b13e28a8d
commit
5e03b122cf
|
@ -1,5 +1,6 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
|
||||||
|
;;; Copyright © 2017 Mathieu Othacehe <m.othacehe@gmail.com>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -23,7 +24,9 @@
|
||||||
#:use-module (srfi srfi-34)
|
#:use-module (srfi srfi-34)
|
||||||
#:use-module (srfi srfi-35)
|
#:use-module (srfi srfi-35)
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
#:export (shepherd-error?
|
#:export (%shepherd-socket-file
|
||||||
|
|
||||||
|
shepherd-error?
|
||||||
service-not-found-error?
|
service-not-found-error?
|
||||||
service-not-found-error-service
|
service-not-found-error-service
|
||||||
action-not-found-error?
|
action-not-found-error?
|
||||||
|
@ -58,9 +61,9 @@
|
||||||
;;; Code:
|
;;; Code:
|
||||||
|
|
||||||
(define %shepherd-socket-file
|
(define %shepherd-socket-file
|
||||||
"/var/run/shepherd/socket")
|
(make-parameter "/var/run/shepherd/socket"))
|
||||||
|
|
||||||
(define* (open-connection #:optional (file %shepherd-socket-file))
|
(define* (open-connection #:optional (file (%shepherd-socket-file)))
|
||||||
"Open a connection to the daemon, using the Unix-domain socket at FILE, and
|
"Open a connection to the daemon, using the Unix-domain socket at FILE, and
|
||||||
return the socket."
|
return the socket."
|
||||||
;; The protocol is sexp-based and UTF-8-encoded.
|
;; The protocol is sexp-based and UTF-8-encoded.
|
||||||
|
|
Loading…
Reference in New Issue