From owner-svn-ports-all@freebsd.org Sat Dec 30 22:25:19 2017 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 DE1E0EAFB2A; Sat, 30 Dec 2017 22:25:19 +0000 (UTC) (envelope-from ler@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 B5649709F5; Sat, 30 Dec 2017 22:25:19 +0000 (UTC) (envelope-from ler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBUMPIUe067410; Sat, 30 Dec 2017 22:25:18 GMT (envelope-from ler@FreeBSD.org) Received: (from ler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBUMPIxV067407; Sat, 30 Dec 2017 22:25:18 GMT (envelope-from ler@FreeBSD.org) Message-Id: <201712302225.vBUMPIxV067407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ler set sender to ler@FreeBSD.org using -f From: Larry Rosenman Date: Sat, 30 Dec 2017 22:25:18 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r457649 - in head/security/clamav: . files X-SVN-Group: ports-head X-SVN-Commit-Author: ler X-SVN-Commit-Paths: in head/security/clamav: . files X-SVN-Commit-Revision: 457649 X-SVN-Commit-Repository: ports 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.25 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: Sat, 30 Dec 2017 22:25:20 -0000 Author: ler Date: Sat Dec 30 22:25:18 2017 New Revision: 457649 URL: https://svnweb.freebsd.org/changeset/ports/457649 Log: security/clamav: handle memfs/tmpfs /var/run. PR: 224728 Submitted by: O. Harmann Modified: head/security/clamav/Makefile head/security/clamav/files/clamav-clamd.in head/security/clamav/files/clamav-freshclam.in Modified: head/security/clamav/Makefile ============================================================================== --- head/security/clamav/Makefile Sat Dec 30 22:24:36 2017 (r457648) +++ head/security/clamav/Makefile Sat Dec 30 22:25:18 2017 (r457649) @@ -3,7 +3,7 @@ PORTNAME= clamav PORTVERSION= 0.99.2 -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= security MASTER_SITES= http://www.clamav.net/downloads/production/ @@ -94,6 +94,7 @@ CLAMAVUSER?= clamav CLAMAVGROUP?= clamav CLAMAV_CLAMD_SOCKET?= ${RUNDIR}/clamd.sock +CLAMAV_CLAMD_PIDFILE?= ${RUNDIR}/clamd.pid CLAMAV_MILTER_SOCKET?= ${RUNDIR}/clmilter.sock SUB_FILES= pkg-deinstall @@ -105,6 +106,7 @@ SUB_LIST+= DBDIR=${DBDIR} \ CLAMAVUSER=${CLAMAVUSER} \ CLAMAVGROUP=${CLAMAVGROUP} \ CLAMAV_CLAMD_SOCKET=${CLAMAV_CLAMD_SOCKET} \ + CLAMAV_CLAMD_PIDFILE=${CLAMAV_CLAMD_PIDFILE} \ CLAMAV_MILTER_SOCKET=${CLAMAV_MILTER_SOCKET} SED_CONF= -E -e 's|^\#?(Example)$$|\#\1|' \ Modified: head/security/clamav/files/clamav-clamd.in ============================================================================== --- head/security/clamav/files/clamav-clamd.in Sat Dec 30 22:24:36 2017 (r457648) +++ head/security/clamav/files/clamav-clamd.in Sat Dec 30 22:25:18 2017 (r457649) @@ -27,6 +27,8 @@ load_rc_config "$name" : ${clamav_clamd_enable:=NO} : ${clamav_clamd_socket="%%CLAMAV_CLAMD_SOCKET%%"} +: ${clamav_clamd_pidfile="%%CLAMAV_CLAMD_PIDFILE%%"} +: ${clamav_clamd_user="%%CLAMAVUSER%%"} command=%%PREFIX%%/sbin/clamd required_dirs=%%DBDIR%% @@ -39,6 +41,10 @@ reload_cmd="%%PREFIX%%/bin/clamdscan --reload" #clamav .93 won't start without a valid main.c[vl]d file clamav_clamd_precmd() { + local rundir=${clamav_clamd_pidfile%/*} + if [ ! -d $rundir ] ; then + install -d -m 0755 -o ${clamav_clamd_user} -g ${clamav_clamd_user} $rundir + fi if [ ! -f %%DBDIR%%/main.cvd -a ! -f %%DBDIR%%/main.cld ];then echo "Missing %%DBDIR%%/*.cvd or *.cld files. You must run freshclam first" exit 1 Modified: head/security/clamav/files/clamav-freshclam.in ============================================================================== --- head/security/clamav/files/clamav-freshclam.in Sat Dec 30 22:24:36 2017 (r457648) +++ head/security/clamav/files/clamav-freshclam.in Sat Dec 30 22:25:18 2017 (r457649) @@ -22,14 +22,27 @@ name=clamav_freshclam rcvar=clamav_freshclam_enable +# read settings, set default values load_rc_config ${name} : ${clamav_freshclam_enable:=NO} +: ${clamav_freshclam_pidfile=%%RUNDIR%%/freshclam.pid} +: ${clamav_freshclam_user=%%CLAMAVUSER%%} command=%%PREFIX%%/bin/freshclam -pidfile=%%RUNDIR%%/freshclam.pid +pidfile=${clamav_freshclam_pidfile} command_args="--daemon -p ${pidfile}" required_dirs=%%DBDIR%% required_files=%%PREFIX%%/etc/freshclam.conf + +start_precmd=clamav_freshclam_precmd + +clamav_freshclam_precmd() +{ + local rundir=${clamav_freshclam_pidfile%/*} + if [ ! -d $rundir ] ; then + install -d -m 0755 -o ${clamav_freshclam_user} -g ${clamav_freshclam_user} $rundir + fi +} run_rc_command "$1"