From owner-svn-ports-all@freebsd.org Tue Dec 1 03:02:18 2015 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 727B2A3D848; Tue, 1 Dec 2015 03:02:18 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2396218FD; Tue, 1 Dec 2015 03:02:18 +0000 (UTC) (envelope-from ache@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB132HoB069610; Tue, 1 Dec 2015 03:02:17 GMT (envelope-from ache@FreeBSD.org) Received: (from ache@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB132HMr069608; Tue, 1 Dec 2015 03:02:17 GMT (envelope-from ache@FreeBSD.org) Message-Id: <201512010302.tB132HMr069608@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ache set sender to ache@FreeBSD.org using -f From: "Andrey A. Chernov" Date: Tue, 1 Dec 2015 03:02:17 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r402719 - in head/mail/opendmarc: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Dec 2015 03:02:18 -0000 Author: ache Date: Tue Dec 1 03:02:16 2015 New Revision: 402719 URL: https://svnweb.freebsd.org/changeset/ports/402719 Log: 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 Modified: head/mail/opendmarc/Makefile head/mail/opendmarc/files/opendmarc.in Modified: head/mail/opendmarc/Makefile ============================================================================== --- head/mail/opendmarc/Makefile Tue Dec 1 03:00:50 2015 (r402718) +++ head/mail/opendmarc/Makefile Tue Dec 1 03:02:16 2015 (r402719) @@ -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 Modified: head/mail/opendmarc/files/opendmarc.in ============================================================================== --- head/mail/opendmarc/files/opendmarc.in Tue Dec 1 03:00:50 2015 (r402718) +++ head/mail/opendmarc/files/opendmarc.in Tue Dec 1 03:02:16 2015 (r402719) @@ -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"