From 7d24351eb239fc9517ec5123ff2fa96a774868e7 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 3 Jan 2019 12:34:02 +0100 Subject: fix --- guix/fixed-fcgiwrap.scm | 48 ++++++++++++++++++++++-------------------------- 1 file changed, 22 insertions(+), 26 deletions(-) (limited to 'guix/fixed-fcgiwrap.scm') 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 make-fcgiwrap-configuration fcgiwrap-configuration? @@ -37,6 +36,24 @@ (ensure-socket-dir? fcgiwrap-ensure-socket-dir? (default #f))) +(define fcgiwrap-accounts + (match-lambda + (($ 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 (($ 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 - (($ 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)))) + -- cgit v1.2.3