summaryrefslogtreecommitdiff
path: root/guix/fixed-fcgiwrap.scm
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2019-01-03 12:34:02 +0100
committerFlorian Dold <florian.dold@gmail.com>2019-01-03 12:34:02 +0100
commit7d24351eb239fc9517ec5123ff2fa96a774868e7 (patch)
treeb5c62ca4038f6f9d500d5be2b626b60c5069a5fe /guix/fixed-fcgiwrap.scm
parent96a89b939337fcdcd2669f7d302c35e58b8a10d4 (diff)
downloaddeployment-7d24351eb239fc9517ec5123ff2fa96a774868e7.tar.gz
deployment-7d24351eb239fc9517ec5123ff2fa96a774868e7.tar.bz2
deployment-7d24351eb239fc9517ec5123ff2fa96a774868e7.zip
fix
Diffstat (limited to 'guix/fixed-fcgiwrap.scm')
-rw-r--r--guix/fixed-fcgiwrap.scm48
1 files changed, 22 insertions, 26 deletions
diff --git a/guix/fixed-fcgiwrap.scm b/guix/fixed-fcgiwrap.scm
index ed0dbbb..b7d778c 100644
--- a/guix/fixed-fcgiwrap.scm
+++ b/guix/fixed-fcgiwrap.scm
@@ -19,7 +19,6 @@
;;;
-
(define-record-type* <fcgiwrap-configuration> fcgiwrap-configuration
make-fcgiwrap-configuration
fcgiwrap-configuration?
@@ -37,6 +36,24 @@
(ensure-socket-dir? fcgiwrap-ensure-socket-dir?
(default #f)))
+(define fcgiwrap-accounts
+ (match-lambda
+ (($ <fcgiwrap-configuration> package socket user group)
+ (filter identity
+ (list
+ (and (equal? group "fcgiwrap")
+ (user-group
+ (name "fcgiwrap")
+ (system? #t)))
+ (and (equal? user "fcgiwrap")
+ (user-account
+ (name "fcgiwrap")
+ (group group)
+ (system? #t)
+ (comment "Fcgiwrap Daemon")
+ (home-directory "/var/empty")
+ (shell (file-append shadow "/sbin/nologin")))))))))
+
(define (parse-fcgiwrap-socket s)
"Parse a fcgiwrap socket specification string into '(type args ...)"
(cond
@@ -60,6 +77,7 @@
(_ (error "invalid tcp6 socket address"))))
(else (error "unrecognized socket protocol"))))
+
(define fcgiwrap-shepherd-service
(match-lambda
(($ <fcgiwrap-configuration> package socket user group perm ensure-dir?)
@@ -102,16 +120,13 @@
(define start-fcgiwrap
(make-forkexec-constructor
'(#$(file-append package "/sbin/fcgiwrap")
- "-s" $#socket)
- #:user #$user
- #:group #$group))
+ "-s" #$socket)
+ #:user #$user #:group #$group))
(match '#$parsed-socket
(('unix path)
;; Clean up socket, otherwise fcgiwrap might not start properly.
- (local-output "cleaning up socket")
(clean-up path)
(when #$ensure-dir?
- (local-output "ensuring socket dir")
(ensure-socket-dir (dirname path) #$user #$group))
(let ((pid (start-fcgiwrap)))
(cond
@@ -122,26 +137,6 @@
(_ (start-fcgiwrap)))))
(stop #~(make-kill-destructor)))))))
-
-(define fcgiwrap-accounts
- (match-lambda
- (($ <fcgiwrap-configuration> package socket user group)
- (filter identity
- (list
- (and (equal? group "fcgiwrap")
- (user-group
- (name "fcgiwrap")
- (system? #t)))
- (and (equal? user "fcgiwrap")
- (user-account
- (name "fcgiwrap")
- (group group)
- (system? #t)
- (comment "Fcgiwrap Daemon")
- (home-directory "/var/empty")
- (shell (file-append shadow "/sbin/nologin")))))))))
-
-
(define fcgiwrap-service-type
(service-type (name 'fcgiwrap)
(extensions
@@ -150,3 +145,4 @@
(service-extension account-service-type
fcgiwrap-accounts)))
(default-value (fcgiwrap-configuration))))
+