svn commit: r467341 - in head/sysutils/sec: . files
Craig Leres
leres at FreeBSD.org
Sat Apr 14 21:15:25 UTC 2018
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 at 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\""
More information about the svn-ports-all
mailing list