[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#54997] [PATCH v2 15/15] services: opendht: Use 'least-authority-wra
From: |
Ludovic Courtès |
Subject: |
[bug#54997] [PATCH v2 15/15] services: opendht: Use 'least-authority-wrapper'. |
Date: |
Wed, 27 Apr 2022 18:56:35 +0200 |
* gnu/services/networking.scm (opendht-configuration->command-line-arguments):
Use 'least-authority-wrapper'.
(opendht-shepherd-service): Use 'make-forkexec-constructor'.
---
gnu/services/networking.scm | 40 ++++++++++++++++++++-----------------
1 file changed, 22 insertions(+), 18 deletions(-)
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 4708ade0ca..5873070bdd 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -796,7 +796,19 @@ (define (opendht-configuration->command-line-arguments
config)
(match-record config <opendht-configuration>
(opendht bootstrap-host enable-logging? port debug? peer-discovery?
proxy-server-port proxy-server-port-tls)
- (let ((dhtnode #~(string-append #$opendht:tools "/bin/dhtnode")))
+ (let ((dhtnode (least-authority-wrapper
+ ;; XXX: Work around lack of support for multiple outputs
+ ;; in 'file-append'.
+ (computed-file "dhtnode"
+ #~(symlink
+ (string-append #$opendht:tools
+ "/bin/dhtnode")
+ #$output))
+ #:name "dhtnode"
+ #:mappings (list (file-system-mapping
+ (source "/dev/log") ;for syslog
+ (target source)))
+ #:namespaces (delq 'net %namespaces))))
`(,dhtnode
"--service" ;non-forking mode
,@(if (string? bootstrap-host)
@@ -822,23 +834,15 @@ (define (opendht-configuration->command-line-arguments
config)
(define (opendht-shepherd-service config)
"Return a <shepherd-service> running OpenDHT."
- (with-imported-modules (source-module-closure
- '((gnu build shepherd)
- (gnu system file-systems)))
- (shepherd-service
- (documentation "Run an OpenDHT node.")
- (provision '(opendht dhtnode dhtproxy))
- (requirement '(networking syslogd))
- (modules '((gnu build shepherd)
- (gnu system file-systems)))
- (start #~(make-forkexec-constructor/container
- (list #$@(opendht-configuration->command-line-arguments config))
- #:mappings (list (file-system-mapping
- (source "/dev/log") ;for syslog
- (target source)))
- #:user "opendht"
- #:group "opendht"))
- (stop #~(make-kill-destructor)))))
+ (shepherd-service
+ (documentation "Run an OpenDHT node.")
+ (provision '(opendht dhtnode dhtproxy))
+ (requirement '(networking syslogd))
+ (start #~(make-forkexec-constructor
+ (list #$@(opendht-configuration->command-line-arguments config))
+ #:user "opendht"
+ #:group "opendht"))
+ (stop #~(make-kill-destructor))))
(define opendht-service-type
(service-type
--
2.35.1
- [bug#54997] [PATCH v2 02/15] file-systems: Avoid load-time warnings when attempting to load (guix store)., (continued)
- [bug#54997] [PATCH v2 02/15] file-systems: Avoid load-time warnings when attempting to load (guix store)., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 12/15] services: wesnothd: Grant write access to /var/run/wesnothd., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 08/15] services: dicod: Use 'make-inetd-constructor'., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 06/15] Add (guix least-authority)., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 07/15] services: dicod: Rewrite using 'least-authority-wrapper'., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 13/15] services: wesnothd: Use 'least-authority-wrapper'., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 10/15] services: ipfs: Adjust for Shepherd 0.9., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 09/15] services: bitlbee: Use 'make-inetd-constructor'., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 11/15] services: ipfs: Use 'least-authority-wrapper'., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 14/15] services: quassel: Use 'least-authority-wrapper'., Ludovic Courtès, 2022/04/27
- [bug#54997] [PATCH v2 15/15] services: opendht: Use 'least-authority-wrapper'.,
Ludovic Courtès <=
- [bug#54997] [PATCH 05/12] services: dicod: Rewrite using 'least-authority-wrapper'., Ludovic Courtès, 2022/04/17
- [bug#54997] [PATCH 07/12] services: bitlbee: Use 'make-inetd-constructor'., Ludovic Courtès, 2022/04/17
- [bug#54997] [PATCH 10/12] services: wesnothd: Grant write access to /var/run/wesnothd., Ludovic Courtès, 2022/04/17
- [bug#54997] [PATCH 11/12] services: wesnothd: Use 'least-authority-wrapper'., Ludovic Courtès, 2022/04/17
- [bug#54997] [PATCH 12/12] services: quassel: Use 'least-authority-wrapper'., Ludovic Courtès, 2022/04/17
[bug#54997] [PATCH 06/12] services: dicod: Use 'make-inetd-constructor'., Ludovic Courtès, 2022/04/17