Skip to contentSkip to conversation

nginx: remove /var/log/nginx when do_install

PATCH New Yi Zhao 1 participant 1 message May 6, 2020

lore
Share & tools
lore

Yi Zhao

author
#0 lore raw

PATCH 1/1 nginx: remove /var/log/nginx when do_install

Remove directory /var/log/nginx when do_install because it is created by volatiles file.

---
 meta-webserver/recipes-httpd/nginx/nginx.inc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta-webserver/recipes-httpd/nginx/nginx.inc +3 -1
index 2824c6652..de080a2b0 100644
@@ -90,7 +90,7 @@ do_install () {
         install -d ${D}${sysconfdir}/tmpfiles.d
         echo "d /run/${BPN} - - - -" \
             > ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
-        echo "d /${localstatedir}/log/${BPN} 0755 root root -" \
+        echo "d ${localstatedir}/log/${BPN} 0755 root root -" \
             >> ${D}${sysconfdir}/tmpfiles.d/${BPN}.conf
     fi
     install -d ${D}${sysconfdir}/${BPN}
@@ -139,6 +139,8 @@ do_install () {
             -e 's,@BASE_BINDIR@,${base_bindir},g' \
             ${D}${systemd_unitdir}/system/nginx.service
     fi
+
+    rm -rf ${D}${localstatedir}/log/
 }
 
 pkg_postinst_${PN} () {
Signature · 1 line
2.17.1