1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-16 07:58:04 +00:00

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
This commit is contained in:
Craig Leres 2018-04-14 21:15:23 +00:00
parent d5a4d63739
commit bae3520a24
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=467341
2 changed files with 15 additions and 3 deletions

View File

@ -2,6 +2,7 @@
PORTNAME= sec
DISTVERSION= 2.7.12
PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= SF/simple-evcorr/${PORTNAME}/${PORTVERSION}

View File

@ -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\""