1) Makes opendmarc rc script more local: sockets friendly (create
directory with needed permissions, start/stop cleanups). 2) Move pidfile to newly created /var/run/opendmarc by default. This directory is perfectly suitable and needed mainly for local: sockets, but to not violate POLA socket still remains as "inet:8893@localhost". Approved by: maintainer timeout
This commit is contained in:
parent
448afeae76
commit
da41230aed
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=402719
2 changed files with 30 additions and 2 deletions
|
@ -3,7 +3,7 @@
|
|||
|
||||
PORTNAME= opendmarc
|
||||
PORTVERSION= 1.3.1
|
||||
PORTREVISION= 1
|
||||
PORTREVISION= 2
|
||||
CATEGORIES= mail security
|
||||
MASTER_SITES= SF/${PORTNAME} \
|
||||
SF/${PORTNAME}/Previous%20Releases
|
||||
|
|
|
@ -19,16 +19,44 @@
|
|||
name="opendmarc"
|
||||
rcvar=opendmarc_enable
|
||||
|
||||
start_precmd="dmarc_prepcmd"
|
||||
stop_postcmd="dmarc_postcmd"
|
||||
command="%%PREFIX%%/sbin/opendmarc"
|
||||
_piddir="/var/run/opendmarc"
|
||||
|
||||
load_rc_config $name
|
||||
|
||||
opendmarc_enable=${opendmarc_enable-"NO"}
|
||||
opendmarc_runas=${opendmarc_runas-"mailnull:mailnull"}
|
||||
opendmarc_pidfile=${opendmarc_pidfile-"/var/run/opendmarc.pid"}
|
||||
opendmarc_pidfile=${opendmarc_pidfile-"${_piddir}/pid"}
|
||||
#opendmarc_socketspec=${opendmarc_socketspec-"local:${_piddir}/socket"}
|
||||
opendmarc_socketspec=${opendmarc_socketspec-"inet:8893@localhost"}
|
||||
opendmarc_cfgfile=${opendmarc_cfgfile-"%%PREFIX%%/etc/mail/opendmarc.conf"}
|
||||
opendmarc_flags=${opendmarc_flags-"-l -P $opendmarc_pidfile \
|
||||
-c $opendmarc_cfgfile -p $opendmarc_socketspec -u $opendmarc_runas"}
|
||||
|
||||
dmarc_prepcmd ()
|
||||
{
|
||||
if [ -S ${opendmarc_socketspec##local:} ] ; then
|
||||
rm -f ${opendmarc_socketspec##local:}
|
||||
elif [ -S ${opendmarc_socketspec##unix:} ] ; then
|
||||
rm -f ${opendmarc_socketspec##unix:}
|
||||
fi
|
||||
if [ ! -d ${_piddir} ] ; then
|
||||
mkdir -p ${_piddir}
|
||||
fi
|
||||
chown ${opendmarc_runas} ${_piddir}
|
||||
}
|
||||
|
||||
dmarc_postcmd()
|
||||
{
|
||||
if [ -S ${opendmarc_socketspec##local:} ] ; then
|
||||
rm -f ${opendmarc_socketspec##local:}
|
||||
elif [ -S ${opendmarc_socketspec##unix:} ] ; then
|
||||
rm -f ${opendmarc_socketspec##unix:}
|
||||
fi
|
||||
# just if the directory is empty
|
||||
rmdir ${_piddir} > /dev/null 2>&1
|
||||
}
|
||||
|
||||
run_rc_command "$1"
|
||||
|
|
Loading…
Reference in a new issue