svn commit: r442557 - in branches/2017Q2/www/fcgiwrap: . files

Matthew Seaman matthew at FreeBSD.org
Sun Jun 4 12:22:45 UTC 2017


Author: matthew
Date: Sun Jun  4 12:22:44 2017
New Revision: 442557
URL: https://svnweb.freebsd.org/changeset/ports/442557

Log:
  MFH: r442556
  
  Avoid accidentally killing init or other important processes when
  running 'service fcgiwrap onestop' if /var/run/fcgiwrap/fcgiwrap.pid
  doesn't exist or contain the fcgiwrap PID.
  
  This prevents killing any processes in process groups 0 or 1 or in the
  caller's process group if the rc script cannot read the fcgiwrap
  pidfile.
  
  PR:		219724
  Submitted by:	bblister at gmail.com
  
  Approved by:	portmgr (implicit blanket: functionality fix)

Modified:
  branches/2017Q2/www/fcgiwrap/Makefile
  branches/2017Q2/www/fcgiwrap/files/fcgiwrap.in
Directory Properties:
  branches/2017Q2/   (props changed)

Modified: branches/2017Q2/www/fcgiwrap/Makefile
==============================================================================
--- branches/2017Q2/www/fcgiwrap/Makefile	Sun Jun  4 12:07:33 2017	(r442556)
+++ branches/2017Q2/www/fcgiwrap/Makefile	Sun Jun  4 12:22:44 2017	(r442557)
@@ -2,7 +2,7 @@
 
 PORTNAME=	fcgiwrap
 PORTVERSION=	1.1.0
-PORTREVISION=	5
+PORTREVISION=	6
 CATEGORIES=	www
 
 MAINTAINER=	ports at FreeBSD.org

Modified: branches/2017Q2/www/fcgiwrap/files/fcgiwrap.in
==============================================================================
--- branches/2017Q2/www/fcgiwrap/files/fcgiwrap.in	Sun Jun  4 12:07:33 2017	(r442556)
+++ branches/2017Q2/www/fcgiwrap/files/fcgiwrap.in	Sun Jun  4 12:22:44 2017	(r442557)
@@ -88,8 +88,10 @@ fcgiwrap_postcmd() {
 }
 
 fcgiwrap_stop() {
-	fcgiwrap_pgrp=$(/bin/ps -o ppid= $(cat ${pidfile}))
-	if [ -z "$fcgiwrap_pgrp" ] || ! kill -0 $fcgiwrap_pgrp; then
+	if [ -s ${pidfile} ]; then
+		fcgiwrap_pgrp=$(/bin/ps -o ppid= $(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


More information about the svn-ports-branches mailing list