From owner-svn-ports-branches@freebsd.org Sun Jun 4 12:22:45 2017 Return-Path: Delivered-To: svn-ports-branches@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8967B7AE57; Sun, 4 Jun 2017 12:22:45 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95EEF74DC4; Sun, 4 Jun 2017 12:22:45 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v54CMivM000712; Sun, 4 Jun 2017 12:22:44 GMT (envelope-from matthew@FreeBSD.org) Received: (from matthew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v54CMiAt000710; Sun, 4 Jun 2017 12:22:44 GMT (envelope-from matthew@FreeBSD.org) Message-Id: <201706041222.v54CMiAt000710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: matthew set sender to matthew@FreeBSD.org using -f From: Matthew Seaman Date: Sun, 4 Jun 2017 12:22:44 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r442557 - in branches/2017Q2/www/fcgiwrap: . files X-SVN-Group: ports-branches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-branches@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the branches of the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Jun 2017 12:22:45 -0000 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@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@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