GNU bug report logs -
#69269
[PATCH] gnu: web: fcgiwrap: remove UNIX socket when service stopped.
Previous Next
Reported by: guix-devel-0brg6b <at> rdmp.org
Date: Mon, 19 Feb 2024 11:17:02 UTC
Severity: normal
Tags: patch
Done: Christopher Baines <mail <at> cbaines.net>
Bug is archived. No further changes may be made.
Full log
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Dale Mellor <blackhole <at> 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
This bug report was last modified 1 year and 130 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.