Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Apr 2018 21:15:24 +0000 (UTC)
From:      Craig Leres <leres@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r467341 - in head/sysutils/sec: . files
Message-ID:  <201804142115.w3ELFOVD098811@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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\""
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804142115.w3ELFOVD098811>