diff options
author | Christopher Larson <chris_larson@mentor.com> | 2019-11-25 21:41:11 +0500 |
---|---|---|
committer | Armin Kuster <akuster808@gmail.com> | 2019-11-27 13:38:58 -0800 |
commit | 484d13bc591e60135e1bb3c3909138ce5bc04572 (patch) | |
tree | 23815fbe9f12df8a3a94435e1ba1ab37ba7e312f | |
parent | b111206c4cb1657768ac6eadc0c939a1df688eec (diff) | |
download | meta-security-484d13bc591e60135e1bb3c3909138ce5bc04572.tar.gz |
clamav: add tmpfiles.d config
This is needed to ensure freshclam's /var/log directory and file are
created when using systemd.
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r-- | recipes-security/clamav/clamav_0.99.4.bb | 8 | ||||
-rw-r--r-- | recipes-security/clamav/files/tmpfiles.clamav | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/recipes-security/clamav/clamav_0.99.4.bb b/recipes-security/clamav/clamav_0.99.4.bb index 7f04337..a340b48 100644 --- a/recipes-security/clamav/clamav_0.99.4.bb +++ b/recipes-security/clamav/clamav_0.99.4.bb | |||
@@ -15,6 +15,7 @@ SRC_URI = "git://github.com/vrtadmin/clamav-devel;branch=rel/0.99 \ | |||
15 | file://clamd.conf \ | 15 | file://clamd.conf \ |
16 | file://freshclam.conf \ | 16 | file://freshclam.conf \ |
17 | file://volatiles.03_clamav \ | 17 | file://volatiles.03_clamav \ |
18 | file://tmpfiles.clamav \ | ||
18 | file://${BPN}.service \ | 19 | file://${BPN}.service \ |
19 | file://freshclam-native.conf \ | 20 | file://freshclam-native.conf \ |
20 | " | 21 | " |
@@ -104,11 +105,15 @@ do_install_append_class-target () { | |||
104 | install -m 666 ${S}/clamav_db/* ${D}/${localstatedir}/lib/clamav/. | 105 | install -m 666 ${S}/clamav_db/* ${D}/${localstatedir}/lib/clamav/. |
105 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then | 106 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then |
106 | install -D -m 0644 ${WORKDIR}/clamav.service ${D}${systemd_unitdir}/system/clamav.service | 107 | install -D -m 0644 ${WORKDIR}/clamav.service ${D}${systemd_unitdir}/system/clamav.service |
108 | install -d ${D}${sysconfdir}/tmpfiles.d | ||
109 | install -m 0644 ${WORKDIR}/tmpfiles.clamav ${D}${sysconfdir}/tmpfiles.d/clamav.conf | ||
107 | fi | 110 | fi |
108 | } | 111 | } |
109 | 112 | ||
110 | pkg_postinst_ontarget_${PN} () { | 113 | pkg_postinst_ontarget_${PN} () { |
111 | if [ -e /etc/init.d/populate-volatile.sh ] ; then | 114 | if command -v systemd-tmpfiles >/dev/null; then |
115 | systemd-tmpfiles --create ${sysconfdir}/tmpfiles.d/clamav.conf | ||
116 | elif [ -e ${sysconfdir}/init.d/populate-volatile.sh ]; then | ||
112 | ${sysconfdir}/init.d/populate-volatile.sh update | 117 | ${sysconfdir}/init.d/populate-volatile.sh update |
113 | fi | 118 | fi |
114 | mkdir -p ${localstatedir}/lib/clamav | 119 | mkdir -p ${localstatedir}/lib/clamav |
@@ -140,6 +145,7 @@ FILES_${PN}-daemon = "${bindir}/clamconf ${bindir}/clamdtop ${sbindir}/clamd \ | |||
140 | FILES_${PN}-freshclam = "${bindir}/freshclam \ | 145 | FILES_${PN}-freshclam = "${bindir}/freshclam \ |
141 | ${sysconfdir}/freshclam.conf* \ | 146 | ${sysconfdir}/freshclam.conf* \ |
142 | ${sysconfdir}/clamav ${sysconfdir}/default/volatiles \ | 147 | ${sysconfdir}/clamav ${sysconfdir}/default/volatiles \ |
148 | ${sysconfdir}/tmpfiles.d/*.conf \ | ||
143 | ${localstatedir}/lib/clamav \ | 149 | ${localstatedir}/lib/clamav \ |
144 | ${docdir}/${PN}-freshclam ${mandir}/man1/freshclam.* \ | 150 | ${docdir}/${PN}-freshclam ${mandir}/man1/freshclam.* \ |
145 | ${mandir}/man5/freshclam.conf.* \ | 151 | ${mandir}/man5/freshclam.conf.* \ |
diff --git a/recipes-security/clamav/files/tmpfiles.clamav b/recipes-security/clamav/files/tmpfiles.clamav new file mode 100644 index 0000000..fd5adfe --- /dev/null +++ b/recipes-security/clamav/files/tmpfiles.clamav | |||
@@ -0,0 +1,3 @@ | |||
1 | #Type Path Mode UID GID Age Argument | ||
2 | d /var/log/clamav 0755 clamav clamav - | ||
3 | f /var/log/clamav/freshclam.log 0644 clamav clamav - | ||