Subject: bug#69269: closed (Re: [bug#69269] [PATCH v3] gnu: fcgiwrap: Update to 1.1.0-1.2870d27, switch to a fork.)

From: [email-masked] (GNU bug Tracking System)
Date: Wed, 13 Mar 2024 13:07:03 +0000

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 [email-masked].

-- 
69269: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69269
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#69269] [PATCH v3] gnu: fcgiwrap: Update to 1.1.0-1.2870d27, switch to a fork.
From: Christopher Baines <[email-masked]>
To: Dale Mellor <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Wed, 13 Mar 2024 13:05:38 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Dale Mellor <[email-masked]> writes:

> From: 宋文武 <[email-masked]>
>
> * 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 <[email-masked]>
>
> 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

Subject: [PATCH] gnu: web: fcgiwrap: remove UNIX socket when service stopped.
From: Dale Mellor <[email-masked]>
To: guix-patches <[email-masked]>
Date: Mon, 19 Feb 2024 10:53:24 +0000
List-Id: <debbugs-submit.debbugs.gnu.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-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