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

* [bug#69269] [PATCH v2] gnu: web: fcgiwrap: remove UNIX socket when service stopped.
  2024-02-19 10:53 [bug#69269] [PATCH] gnu: web: fcgiwrap: remove UNIX socket when service stopped Dale Mellor
@ 2024-03-09  9:23 ` 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
  1 sibling, 1 reply; 5+ messages in thread
From: Dale Mellor @ 2024-03-09  9:23 UTC (permalink / raw)
  To: 69269; +Cc: blackhole

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





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

* [bug#69269] [PATCH v2] gnu: web: fcgiwrap: remove UNIX socket when service stopped.
  2024-03-09  9:23 ` [bug#69269] [PATCH v2] " Dale Mellor
@ 2024-03-10  2:56   ` 宋文武 via Guix-patches via
  0 siblings, 0 replies; 5+ messages in thread
From: 宋文武 via Guix-patches via @ 2024-03-10  2:56 UTC (permalink / raw)
  To: Dale Mellor; +Cc: 69269, blackhole

Dale Mellor <guix-devel-0brg6b@rdmp.org> writes:

> 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.

Hello, I have sent a patch to update fcgiwrap to a more maintained fork,
which have the needed socket clean logic itself.

Please give it a test, I think it's better than handling that in
shepherd.  Thanks!




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

* [bug#69269] [PATCH v3] gnu: fcgiwrap: Update to 1.1.0-1.2870d27, switch to a fork.
  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-12 13:48 ` Dale Mellor
  2024-03-13 13:05   ` Christopher Baines
  1 sibling, 1 reply; 5+ messages in thread
From: Dale Mellor @ 2024-03-12 13:48 UTC (permalink / raw)
  To: 69269; +Cc: iyzsong, guix-devel-0brg6b

From: 宋文武 <iyzsong@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@rdmp.org>

Change-Id: Ia9e7b911a0c8bde50924e3398f915f945cf955a6
---
 gnu/packages/web.scm | 68 +++++++++++++++++++++++---------------------
 1 file changed, 36 insertions(+), 32 deletions(-)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index ddc673896b..f163802a60 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -1109,40 +1109,44 @@ (define-public fcgi
     (license (license:non-copyleft "file://LICENSE.TERMS"))))
 
 (define-public fcgiwrap
-  (package
-    (name "fcgiwrap")
-    (version "1.1.0")
-    (source
-     (origin
-       (method git-fetch)
-       (uri (git-reference
-             (url "https://github.com/gnosek/fcgiwrap")
-             (commit version)))
-       (file-name (git-file-name name version))
-       (sha256
-        (base32 "1ryw66h9aazi83amk8l7ha8k5g0c7qvk5g6jv376a1ws9xk2qw6f"))))
-    (build-system gnu-build-system)
-    (arguments
-     `(#:tests? #f                      ; no tests included
-       #:make-flags (list "CC=gcc")
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'fix-CFLAGS
-           ;; Remove broken options unconditionally added to CFLAGS.
-           (lambda _
-             (substitute* "configure.ac"
-               ((" -Werror") ""))
-             #t)))))
-    (native-inputs
-     (list autoconf automake pkg-config))
-    (inputs
-     (list fcgi))
-    (home-page "https://nginx.localdomain.pl/wiki/FcgiWrap")
-    (synopsis "Simple server for running CGI applications over FastCGI")
-    (description "Fcgiwrap is a simple server for running CGI applications
+  (let ((commit "2870d2729a3930988f0041e2d78fec672e69afac")
+        (revision "1"))
+    (package
+      (name "fcgiwrap")
+      (version (git-version "1.1.0" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               ;; Upstream last updated in 2015, this forked version has better
+               ;; socket cleanup.
+               (url "https://github.com/flu0r1ne/fcgiwrap")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0rkpp4apfhdcrmym3pcpqlncd0r4fyr3pa45i8g6x4p38b4azmmm"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:tests? #f                    ; no tests included
+         #:make-flags (list "CC=gcc")
+         #:phases
+         (modify-phases %standard-phases
+           (add-after 'unpack 'fix-CFLAGS
+             ;; Remove broken options unconditionally added to CFLAGS.
+             (lambda _
+               (substitute* "configure.ac"
+                 ((" -Werror") ""))
+               #t)))))
+      (native-inputs
+       (list autoconf automake pkg-config))
+      (inputs
+       (list fcgi))
+      (home-page "https://nginx.localdomain.pl/wiki/FcgiWrap")
+      (synopsis "Simple server for running CGI applications over FastCGI")
+      (description "Fcgiwrap is a simple server for running CGI applications
 over FastCGI.  It hopes to provide clean CGI support to Nginx (and other web
 servers that may need it).")
-    (license license:expat)))
+      (license license:expat))))
 
 (define-public starman
   (package
-- 
2.41.0





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

* [bug#69269] [PATCH v3] gnu: fcgiwrap: Update to 1.1.0-1.2870d27, switch to a fork.
  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
  0 siblings, 0 replies; 5+ messages in thread
From: Christopher Baines @ 2024-03-13 13:05 UTC (permalink / raw)
  To: Dale Mellor; +Cc: iyzsong, 69269-done, 69269

[-- Attachment #1: Type: text/plain, Size: 870 bytes --]


Dale Mellor <guix-devel-0brg6b@rdmp.org> writes:

> From: 宋文武 <iyzsong@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@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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 987 bytes --]

^ permalink raw reply	[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.