summaryrefslogtreecommitdiff
path: root/gnu/services/web.scm
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2020-09-05 21:56:34 +0300
committerEfraim Flashner <efraim@flashner.co.il>2020-09-05 22:30:04 +0300
commitde3c03a47160dec355d9b19ad5ca210d90c15fd7 (patch)
tree4ca6dc05b5fc9530d812bbb269f1c61ab9efccf3 /gnu/services/web.scm
parentab6fe9d362046231ad6f46eccfd1ea2c9c80b401 (diff)
parentb8477cab7bccc4191ed3dfa3f149aec7917834d8 (diff)
downloadguix-patches-de3c03a47160dec355d9b19ad5ca210d90c15fd7.tar
guix-patches-de3c03a47160dec355d9b19ad5ca210d90c15fd7.tar.gz
Merge remote-tracking branch 'origin/master' into staging
Diffstat (limited to 'gnu/services/web.scm')
-rw-r--r--gnu/services/web.scm19
1 files changed, 18 insertions, 1 deletions
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