www/fcgiwrap patch

Jávorszky Balázs javorszky.balazs at gmail.com
Sun Nov 8 12:53:26 PST 2020


Hi,

I have to use www/fcgiwrap with nginx (pls don't ask why :) I would 
avoid CGI if I could). The /usr/local/etc/rc.d/fcgiwrap file has minor 
issues. Interesting but this doesn't affect the identical FreeBSD 
version, I've tried that too.

I've included the patch. First I wanted to push the diff but it was 
quite complicated to get the environment working ( 
https://www.dragonflybsd.org/docs/howtos/HowToDPorts/ ), that would've 
taken ages. I'm sorry. The change is minor and it works.

(A note: it only worked for me if fcgiwrap_<profilename>_user was "root" 
and fcgiwrap_socket_owner was "www" in /etc/rc.conf, ie. the same as the 
one of nginx workers'. The FreeBSD version behaved identically.)

Regards,

Balazs Javorszky

The patch:

--- fcgiwrap.in.orig 2020-10-06 10:17:53.243123000 +0200
+++ fcgiwrap.in        2020-11-08 19:37:29.153520000 +0100
@@ -97,14 +97,14 @@

  fcgiwrap_stop() {
         if [ -s ${pidfile} ]; then
-               fcgiwrap_pgrp=$(/bin/ps -o ppid= $(cat ${pidfile}))
+               fcgiwrap_pgrp=$(/bin/ps -o ppid= -p $(cat ${pidfile}))
         fi
         if [ -z "$fcgiwrap_pgrp" -o "${fcgiwrap_pgrp:-0}" -le 1 ] || ! 
kill -0 $fcgiwrap_pgrp; then
                 [ -n "$rc_fast" ] && return 0
                 _run_rc_notrunning
                 return 1
         fi
-       fcgiwrap_pgrp_pids=$(/bin/pgrep -d ' ' -g ${fcgiwrap_pgrp})
+       fcgiwrap_pgrp_pids=$(/usr/bin/pgrep -d ' ' -g ${fcgiwrap_pgrp})
         echo "Stopping ${name}."
         kill -TERM -- -${fcgiwrap_pgrp}
         wait_for_pids ${fcgiwrap_pgrp_pids}





More information about the Users mailing list