aboutsummaryrefslogtreecommitdiff
path: root/security/clamav
diff options
context:
space:
mode:
authorLarry Rosenman <ler@FreeBSD.org>2017-12-30 22:25:18 +0000
committerLarry Rosenman <ler@FreeBSD.org>2017-12-30 22:25:18 +0000
commit181b7c02ee39da406f0cb08f79f8e9f6f3ecdc0a (patch)
tree1fc08b502909aba1713678800e7ddb753c4bb943 /security/clamav
parentd7b612b75334ce25bc0a553a0fe4fdc3d4165abe (diff)
downloadports-181b7c02ee39da406f0cb08f79f8e9f6f3ecdc0a.tar.gz
ports-181b7c02ee39da406f0cb08f79f8e9f6f3ecdc0a.zip
security/clamav: handle memfs/tmpfs /var/run.
PR: 224728 Submitted by: O. Harmann <ohartmann@walstatt.org>
Notes
Notes: svn path=/head/; revision=457649
Diffstat (limited to 'security/clamav')
-rw-r--r--security/clamav/Makefile4
-rw-r--r--security/clamav/files/clamav-clamd.in6
-rw-r--r--security/clamav/files/clamav-freshclam.in15
3 files changed, 23 insertions, 2 deletions
diff --git a/security/clamav/Makefile b/security/clamav/Makefile
index 1b7c19e02ac6..e0e510d9dc5d 100644
--- a/security/clamav/Makefile
+++ b/security/clamav/Makefile
@@ -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|' \
diff --git a/security/clamav/files/clamav-clamd.in b/security/clamav/files/clamav-clamd.in
index 9369132b6cd7..ac886410217d 100644
--- a/security/clamav/files/clamav-clamd.in
+++ b/security/clamav/files/clamav-clamd.in
@@ -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
diff --git a/security/clamav/files/clamav-freshclam.in b/security/clamav/files/clamav-freshclam.in
index 6f3165117817..49239fbfe8d9 100644
--- a/security/clamav/files/clamav-freshclam.in
+++ b/security/clamav/files/clamav-freshclam.in
@@ -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"