mongodb: Create /var/log/mongodb in runtime

/var/log is normally a link to /var/volatile/log and /var/volatile is a
tmpfs mount. So anything created in /var/log will not be available when
the tmpfs is mounted.

Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Peter Kjellerstedt
2021-11-02 19:51:43 +01:00
committed by Khem Raj
parent 563577f488
commit 89391ee45e
@@ -113,11 +113,19 @@ scons_do_install() {
install -m 755 -d ${D}${localstatedir}/lib/${BPN}
chown ${PN}:${PN} ${D}${localstatedir}/lib/${BPN}
# Log files
install -m 755 -d ${D}${localstatedir}/log/${BPN}
chown ${PN}:${PN} ${D}${localstatedir}/log/${BPN}
# Create /var/log/mongodb in runtime.
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}" ]; then
install -d ${D}${nonarch_libdir}/tmpfiles.d
echo "d ${localstatedir}/log/${BPN} 0755 ${BPN} ${BPN} -" > ${D}${nonarch_libdir}/tmpfiles.d/${BPN}.conf
fi
if [ "${@bb.utils.filter('DISTRO_FEATURES', 'sysvinit', d)}" ]; then
install -d ${D}${sysconfdir}/default/volatiles
echo "d ${BPN} ${BPN} 0755 ${localstatedir}/log/${BPN} none" > ${D}${sysconfdir}/default/volatiles/99_${BPN}
fi
}
CONFFILES:${PN} = "${sysconfdir}/mongod.conf"
SYSTEMD_SERVICE:${PN} = "mongod.service"
FILES:${PN} += "${nonarch_libdir}/tmpfiles.d"