(address . guix-patches@gnu.org)
Hi Guix!
When updating my system, I noticed there was a duplicate php-fpm group.
The reason is that by default, the group is php-fpm, and the accounts
list contains php-fpm and the configured group. I'm not sure why, but
the hardcoded php-fpm group seems to be used by the user as a
supplementary group.
This patch only adds the php-fpm group when the configured group is not
already php-fpm. If you think it'd be better, we could also simply
remove the hard-coded php-fpm group and the supplementary group from
the php-fpm user.
From d50e84c66d9cc9fa027035b9265e80ecab22aa00 Mon Sep 17 00:00:00 2001
From: Julien Lepiller <julien@lepiller.eu>
Date: Sat, 16 Jan 2021 20:42:32 +0100
Subject: [PATCH] gnu: php-fpm: Ensure no duplicate group.
* gnu/services/web.scm (php-fpm-accounts): Ensure `php-fpm` group is not
duplicated.
---
gnu/services/web.scm | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
Toggle diff (40 lines)
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 855f4e649b..f8dc621614 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -922,19 +922,20 @@ of index files."
(define php-fpm-accounts
(match-lambda
(($ <php-fpm-configuration> php socket user group socket-user socket-group _ _ _ _ _ _)
- (list
- (user-group (name "php-fpm") (system? #t))
- (user-group
- (name group)
- (system? #t))
- (user-account
- (name user)
- (group group)
- (supplementary-groups '("php-fpm"))
- (system? #t)
- (comment "php-fpm daemon user")
- (home-directory "/var/empty")
- (shell (file-append shadow "/sbin/nologin")))))))
+ `(,@(if (equal? group "php-fpm")
+ '()
+ (list (user-group (name "php-fpm") (system? #t))))
+ ,(user-group
+ (name group)
+ (system? #t))
+ ,(user-account
+ (name user)
+ (group group)
+ (supplementary-groups '("php-fpm"))
+ (system? #t)
+ (comment "php-fpm daemon user")
+ (home-directory "/var/empty")
+ (shell (file-append shadow "/sbin/nologin")))))))
(define (default-php-fpm-config socket user group socket-user socket-group
pid-file log-file pm display-errors timezone workers-log-file)
--
2.30.0