Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 Dec 2017 22:25:18 +0000 (UTC)
From:      Larry Rosenman <ler@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r457649 - in head/security/clamav: . files
Message-ID:  <201712302225.vBUMPIxV067407@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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 <ohartmann@walstatt.org>

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"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201712302225.vBUMPIxV067407>