all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#69269] [PATCH] gnu: web: fcgiwrap: remove UNIX socket when service stopped.
@ 2024-02-19 10:53 Dale Mellor
  2024-03-09  9:23 ` [bug#69269] [PATCH v2] " Dale Mellor
  2024-03-12 13:48 ` [bug#69269] [PATCH v3] gnu: fcgiwrap: Update to 1.1.0-1.2870d27, switch to a fork Dale Mellor
  0 siblings, 2 replies; 5+ messages in thread
From: Dale Mellor @ 2024-02-19 10:53 UTC (permalink / raw)
  To: 69269

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-13 13:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-19 10:53 [bug#69269] [PATCH] gnu: web: fcgiwrap: remove UNIX socket when service stopped Dale Mellor
2024-03-09  9:23 ` [bug#69269] [PATCH v2] " Dale Mellor
2024-03-10  2:56   ` 宋文武 via Guix-patches via
2024-03-12 13:48 ` [bug#69269] [PATCH v3] gnu: fcgiwrap: Update to 1.1.0-1.2870d27, switch to a fork Dale Mellor
2024-03-13 13:05   ` Christopher Baines

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.