From e01bc3a7219da6c9f32cf33f375346633ad2bbea Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt Date: Tue, 2 Nov 2021 19:51:43 +0100 Subject: 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 Signed-off-by: Khem Raj --- .../meta-python/recipes-dbs/mongodb/mongodb_git.bb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb index 461a1d0079..1b11bd4dca 100644 --- a/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb +++ b/meta-oe/dynamic-layers/meta-python/recipes-dbs/mongodb/mongodb_git.bb @@ -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" -- cgit 1.2.3-korg