aboutsummaryrefslogtreecommitdiff
path: root/www/fcgiwrap
diff options
context:
space:
mode:
authorAdam Weinberger <adamw@FreeBSD.org>2017-05-26 16:54:40 +0000
committerAdam Weinberger <adamw@FreeBSD.org>2017-05-26 16:54:40 +0000
commite9fafcaa9d611ae8e70dd4c1d418207fb94c2715 (patch)
tree704f9c2fcecf5259083ebe8a2c9613418194ef25 /www/fcgiwrap
parent5147a61834ef70db99b3071629e963963df07408 (diff)
downloadports-e9fafcaa9d611ae8e70dd4c1d418207fb94c2715.tar.gz
ports-e9fafcaa9d611ae8e70dd4c1d418207fb94c2715.zip
Fix stale processes not being terminated by the rc(8) script.
Previously, when fcgiwrap_flags="-c [n]" with n > 1, only the controlling process was terminated, with the children running. This patch fixes this behaviour, terminating the children. PR: 217297 Submitted by: lstewart Reported by: spry anarchy in the ph MFH: 2017Q2
Notes
Notes: svn path=/head/; revision=441799
Diffstat (limited to 'www/fcgiwrap')
-rw-r--r--www/fcgiwrap/Makefile2
-rw-r--r--www/fcgiwrap/files/fcgiwrap.in15
2 files changed, 14 insertions, 3 deletions
diff --git a/www/fcgiwrap/Makefile b/www/fcgiwrap/Makefile
index ab131661e605..54f20c2f53f4 100644
--- a/www/fcgiwrap/Makefile
+++ b/www/fcgiwrap/Makefile
@@ -2,7 +2,7 @@
PORTNAME= fcgiwrap
PORTVERSION= 1.1.0
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= www
MAINTAINER= ports@FreeBSD.org
diff --git a/www/fcgiwrap/files/fcgiwrap.in b/www/fcgiwrap/files/fcgiwrap.in
index 4de8902c9850..daa165490606 100644
--- a/www/fcgiwrap/files/fcgiwrap.in
+++ b/www/fcgiwrap/files/fcgiwrap.in
@@ -87,7 +87,18 @@ fcgiwrap_postcmd() {
fi
}
-fcgiwrap_cleansocket() {
+fcgiwrap_stop() {
+ fcgiwrap_pgrp=$(/bin/ps -o ppid= $(cat ${pidfile}))
+ if [ -z "$fcgiwrap_pgrp" ] || ! 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})
+ echo "Stopping ${name}."
+ kill -TERM -- -${fcgiwrap_pgrp}
+ wait_for_pids ${fcgiwrap_pgrp_pids}
+
# Workaround the fact that fcgiwrap doesn't cleanup his socket at stopping
case ${fcgiwrap_socket} in
unix*)
@@ -104,7 +115,7 @@ procname="%%PREFIX%%/sbin/${name}"
command="/usr/sbin/daemon"
start_precmd="fcgiwrap_precmd"
start_postcmd="fcgiwrap_postcmd"
-stop_postcmd="fcgiwrap_cleansocket"
+stop_cmd="fcgiwrap_stop"
load_rc_config $name