[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#54997] [PATCH 11/12] services: wesnothd: Use 'least-authority-wrapp
From: |
Ludovic Courtès |
Subject: |
[bug#54997] [PATCH 11/12] services: wesnothd: Use 'least-authority-wrapper'. |
Date: |
Sun, 17 Apr 2022 23:04:52 +0200 |
* gnu/services/games.scm (wesnothd-shepherd-service): Use
'least-authority-wrapper' instead of
'make-forkexec-constructor/container'.
---
gnu/services/games.scm | 25 +++++++++++++------------
1 file changed, 13 insertions(+), 12 deletions(-)
diff --git a/gnu/services/games.scm b/gnu/services/games.scm
index dc0bfbe9dc..6c2af44b49 100644
--- a/gnu/services/games.scm
+++ b/gnu/services/games.scm
@@ -23,6 +23,9 @@ (define-module (gnu services games)
#:use-module (gnu packages admin)
#:use-module (gnu packages games)
#:use-module (gnu system shadow)
+ #:use-module ((gnu system file-systems) #:select (file-system-mapping))
+ #:use-module (gnu build linux-container)
+ #:autoload (guix least-authority) (least-authority-wrapper)
#:use-module (guix gexp)
#:use-module (guix modules)
#:use-module (guix records)
@@ -57,22 +60,20 @@ (define %wesnothd-accounts
(define wesnothd-shepherd-service
(match-lambda
(($ <wesnothd-configuration> package port)
- (with-imported-modules (source-module-closure
- '((gnu build shepherd)
- (gnu system file-systems)))
+ (let ((wesnothd (least-authority-wrapper
+ (file-append package "/bin/wesnothd")
+ #:name "wesnothd"
+ #:mappings (list (file-system-mapping
+ (source "/var/run/wesnothd")
+ (target source)
+ (writable? #t)))
+ #:namespaces (delq 'net %namespaces))))
(shepherd-service
(documentation "The Battle for Wesnoth server")
(provision '(wesnoth-daemon))
(requirement '(networking))
- (modules '((gnu build shepherd)
- (gnu system file-systems)))
- (start #~(make-forkexec-constructor/container
- (list #$(file-append package "/bin/wesnothd")
- "-p" #$(number->string port))
- #:mappings (list (file-system-mapping
- (source "/var/run/wesnothd")
- (target source)
- (writable? #t)))
+ (start #~(make-forkexec-constructor
+ (list #$wesnothd "-p" #$(number->string port))
#:user "wesnothd" #:group "wesnothd"))
(stop #~(make-kill-destructor)))))))
--
2.35.1
- [bug#54997] [PATCH v2 10/15] services: ipfs: Adjust for Shepherd 0.9., (continued)
- [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, 2022/04/27
- [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 <=
- [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
[bug#54997] [PATCH 08/12] services: ipfs: Adjust for Shepherd 0.9., Ludovic Courtès, 2022/04/17
[bug#54997] [PATCH 09/12] services: ipfs: Use 'least-authority-wrapper'., Ludovic Courtès, 2022/04/17