* [bug#42918] [PATCH 0/1] services: fcgiwrap: Create parent directory for unix socket.
@ 2020-08-18 18:17 Arun Isaac
2020-08-18 18:20 ` [bug#42918] [PATCH 1/1] " Arun Isaac
0 siblings, 1 reply; 4+ messages in thread
From: Arun Isaac @ 2020-08-18 18:17 UTC (permalink / raw)
To: 42918; +Cc: Arun Isaac
Currently, fcgiwrap listening on a unix socket is unworkable since the
fcgiwrap user may not have the necessary permissions to create the socket
file.
Arun Isaac (1):
services: fcgiwrap: Create parent directory for unix socket.
gnu/services/web.scm | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
--
2.28.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [bug#42918] [PATCH 1/1] services: fcgiwrap: Create parent directory for unix socket.
2020-08-18 18:17 [bug#42918] [PATCH 0/1] services: fcgiwrap: Create parent directory for unix socket Arun Isaac
@ 2020-08-18 18:20 ` Arun Isaac
2020-08-24 9:25 ` Mathieu Othacehe
0 siblings, 1 reply; 4+ messages in thread
From: Arun Isaac @ 2020-08-18 18:20 UTC (permalink / raw)
To: 42918; +Cc: Arun Isaac
* gnu/services/web.scm (fcgiwrap-activation): New function.
(fcgiwrap-service-type): Extend activation-service-type with
fcgiwrap-activation.
---
gnu/services/web.scm | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 3b9f9e40be..d11a1c0545 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -12,6 +12,7 @@
;;; Copyright © 2019, 2020 Florian Pelz <pelzflorian@pelzflorian.de>
;;; Copyright © 2020 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2020 Arun Isaac <arunisaac@systemreboot.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -794,13 +795,29 @@ of index files."
#:user #$user #:group #$group))
(stop #~(make-kill-destructor)))))))
+(define fcgiwrap-activation
+ (match-lambda
+ (($ <fcgiwrap-configuration> package socket user group)
+ #~(begin
+ ;; When listening on a unix socket, create a parent directory for the
+ ;; socket with the correct permissions.
+ (when (string-prefix? "unix:" #$socket)
+ (let ((run-directory
+ (dirname (substring #$socket (string-length "unix:")))))
+ (mkdir-p run-directory)
+ (chown run-directory
+ (passwd:uid (getpw #$user))
+ (group:gid (getgr #$group)))))))))
+
(define fcgiwrap-service-type
(service-type (name 'fcgiwrap)
(extensions
(list (service-extension shepherd-root-service-type
fcgiwrap-shepherd-service)
(service-extension account-service-type
- fcgiwrap-accounts)))
+ fcgiwrap-accounts)
+ (service-extension activation-service-type
+ fcgiwrap-activation)))
(default-value (fcgiwrap-configuration))))
(define-record-type* <php-fpm-configuration> php-fpm-configuration
--
2.28.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [bug#42918] [PATCH 1/1] services: fcgiwrap: Create parent directory for unix socket.
2020-08-18 18:20 ` [bug#42918] [PATCH 1/1] " Arun Isaac
@ 2020-08-24 9:25 ` Mathieu Othacehe
2020-08-26 17:57 ` bug#42918: " Arun Isaac
0 siblings, 1 reply; 4+ messages in thread
From: Mathieu Othacehe @ 2020-08-24 9:25 UTC (permalink / raw)
To: Arun Isaac; +Cc: 42918
Hey Arun,
> * gnu/services/web.scm (fcgiwrap-activation): New function.
> (fcgiwrap-service-type): Extend activation-service-type with
> fcgiwrap-activation.
This looks fine, feel free to proceed!
Thanks,
Mathieu
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#42918: [PATCH 1/1] services: fcgiwrap: Create parent directory for unix socket.
2020-08-24 9:25 ` Mathieu Othacehe
@ 2020-08-26 17:57 ` Arun Isaac
0 siblings, 0 replies; 4+ messages in thread
From: Arun Isaac @ 2020-08-26 17:57 UTC (permalink / raw)
To: Mathieu Othacehe; +Cc: 42918-done
[-- Attachment #1: Type: text/plain, Size: 42 bytes --]
Thanks for the review, pushed to master!
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-08-26 17:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-18 18:17 [bug#42918] [PATCH 0/1] services: fcgiwrap: Create parent directory for unix socket Arun Isaac
2020-08-18 18:20 ` [bug#42918] [PATCH 1/1] " Arun Isaac
2020-08-24 9:25 ` Mathieu Othacehe
2020-08-26 17:57 ` bug#42918: " Arun Isaac
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).