[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#69269] [PATCH v2] gnu: web: fcgiwrap: remove UNIX socket when servi
From: |
Dale Mellor |
Subject: |
[bug#69269] [PATCH v2] gnu: web: fcgiwrap: remove UNIX socket when service stopped. |
Date: |
Sat, 9 Mar 2024 09:23:11 +0000 |
From: Dale Mellor <blackhole@rdmp.org>
The generic kill destructor is used to terminate the process, but if it was
configured to use a UNIX socket, that socket gets left behind. Subsequent
attempts to re-start the service then fail with a 'socket in use' error. So
we perform extra duty in the stop action to clean up if necessary.
* gnu/services/web.scm: new logic in fcgiwrap-shephard-service.
---
gnu/services/web.scm | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 05fd71f9949..877e15342b0 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -907,7 +907,14 @@ (define fcgiwrap-shepherd-service
"-s" #$socket)
#:user #$user #:group #$group
#:log-file "/var/log/fcgiwrap.log"))
- (stop #~(make-kill-destructor)))))))
+ (stop #~(let ((mkd (make-kill-destructor)))
+ (lambda x
+ (apply mkd x)
+ (when (string-prefix? "unix:" #$socket)
+ (let ((socket (substring #$socket 5)))
+ (when (access? socket F_OK)
+ (delete-file socket))))
+ #f))))))))
(define fcgiwrap-activation
(match-lambda
--
2.41.0
- [bug#69269] [PATCH v2] gnu: web: fcgiwrap: remove UNIX socket when service stopped.,
Dale Mellor <=