From owner-svn-ports-all@freebsd.org Sat Apr 14 21:15:25 2018 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF59EF9AC58; Sat, 14 Apr 2018 21:15:24 +0000 (UTC) (envelope-from leres@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6121E767C5; Sat, 14 Apr 2018 21:15:24 +0000 (UTC) (envelope-from leres@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 408252D72E; Sat, 14 Apr 2018 21:15:24 +0000 (UTC) (envelope-from leres@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3ELFOZ8098813; Sat, 14 Apr 2018 21:15:24 GMT (envelope-from leres@FreeBSD.org) Received: (from leres@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3ELFOVD098811; Sat, 14 Apr 2018 21:15:24 GMT (envelope-from leres@FreeBSD.org) Message-Id: <201804142115.w3ELFOVD098811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: leres set sender to leres@FreeBSD.org using -f From: Craig Leres Date: Sat, 14 Apr 2018 21:15:24 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r467341 - in head/sysutils/sec: . files X-SVN-Group: ports-head X-SVN-Commit-Author: leres X-SVN-Commit-Paths: in head/sysutils/sec: . files X-SVN-Commit-Revision: 467341 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Apr 2018 21:15:25 -0000 Author: leres Date: Sat Apr 14 21:15:23 2018 New Revision: 467341 URL: https://svnweb.freebsd.org/changeset/ports/467341 Log: Move the pidfile from /var/run/sec.pid to /var/run/sec/sec.pid and chown /var/run/sec when sec_user is set. PR: 227056 Reviewed by: ler (mentor) Approved by: ecu@200ok.org, ler (mentor) Differential Revision: https://reviews.freebsd.org/D15068 Modified: head/sysutils/sec/Makefile head/sysutils/sec/files/sec.in Modified: head/sysutils/sec/Makefile ============================================================================== --- head/sysutils/sec/Makefile Sat Apr 14 18:45:17 2018 (r467340) +++ head/sysutils/sec/Makefile Sat Apr 14 21:15:23 2018 (r467341) @@ -2,6 +2,7 @@ PORTNAME= sec DISTVERSION= 2.7.12 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= SF/simple-evcorr/${PORTNAME}/${PORTVERSION} Modified: head/sysutils/sec/files/sec.in ============================================================================== --- head/sysutils/sec/files/sec.in Sat Apr 14 18:45:17 2018 (r467340) +++ head/sysutils/sec/files/sec.in Sat Apr 14 21:15:23 2018 (r467341) @@ -34,9 +34,9 @@ command="%%PREFIX%%/bin/sec" command_args="-detach" command_interpreter="%%PERL%%" extra_commands="reload" -pidfile="/var/run/sec.pid" +pidfile="/var/run/sec/sec.pid" -start_precmd="sec_checkconfig" +start_precmd="sec_precmd" reload_precmd="sec_checkconfig" restart_precmd="sec_checkconfig" sig_reload=HUP @@ -46,6 +46,17 @@ load_rc_config "${name}" [ -z "${sec_flags}" ] && sec_flags="-log=/var/log/sec.log" [ -z "${sec_configfile}" ] && sec_configfile="%%PREFIX%%/etc/sec.conf" +sec_precmd() { + dn=`dirname ${pidfile}` + if [ ! -d ${dn} ]; then + mkdir -p ${dn} + if [ -n $sec_user ]; then + /usr/sbin/chown ${sec_user} ${dn} + fi + fi + sec_checkconfig +} + sec_checkconfig() { if [ -z $instance ] then @@ -75,7 +86,7 @@ then do # Iterate through all instances name="sec_${instance}" - pidfile="/var/run/sec_${instance}.pid" + pidfile="/var/run/sec/sec_${instance}.pid" eval required_files=\$sec_${instance}_configfile eval sec_${instance}_flags="\"-conf=\$sec_${instance}_configfile -pid=\$pidfile \$sec_${instance}_flags\""