Index: head/sysutils/sec/Makefile =================================================================== --- head/sysutils/sec/Makefile +++ head/sysutils/sec/Makefile @@ -2,6 +2,7 @@ PORTNAME= sec DISTVERSION= 2.7.12 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= SF/simple-evcorr/${PORTNAME}/${PORTVERSION} Index: head/sysutils/sec/files/sec.in =================================================================== --- head/sysutils/sec/files/sec.in +++ head/sysutils/sec/files/sec.in @@ -34,9 +34,9 @@ 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 @@ [ -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 @@ 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\""