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
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#69269: [PATCH] gnu: web: fcgiwrap: remove UNIX socket when service stopped.
which was filed against the guix-patches package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 69269 <at> debbugs.gnu.org.
--
69269: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69269
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
Dale Mellor <guix-devel-0brg6b <at> rdmp.org> writes:
> From: 宋文武 <iyzsong <at> member.fsf.org>
>
> * gnu/packages/web.scm (fcgiwrap): Update to 1.1.0-1.2870d27.
> [source]: Switch to https://github.com/flu0r1ne/fcgiwrap.
>
> Dale Mellor:
> - This looks good to me
>
> - Checked the change in the delta and the forked repository, both are
> simple and clean
>
> - The functionality works as advertised, and fixes the original problem
> that 'herd restart fcgiwrap' now works properly
>
> Reviewed-by: Dale Mellor <guix-devel-0brg6b <at> rdmp.org>
>
> Change-Id: Ia9e7b911a0c8bde50924e3398f915f945cf955a6
> ---
> gnu/packages/web.scm | 68 +++++++++++++++++++++++---------------------
> 1 file changed, 36 insertions(+), 32 deletions(-)
Thanks both, I've pushed this to master as
7b5c030684020282a690322b558f86718eb148a7.
Chris
[signature.asc (application/pgp-signature, inline)]
[Message part 5 (message/rfc822, inline)]
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-shepherd-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.