[meta-virtualization] [m-c-s][PATCH] apache: changes to support systemd

Mark Asselstine mark.asselstine at windriver.com
Wed Nov 22 08:07:40 PST 2017


Auto start apache2 and adapt how we change the logging location from
/var/apache2/logs to /var/log/apache2. Sysvinit specific changes are
removed as we only plan to support systemd.

Signed-off-by: Mark Asselstine <mark.asselstine at windriver.com>
---
 meta-openstack/recipes-httpd/apache2/apache2_2.4.%.bbappend | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/meta-openstack/recipes-httpd/apache2/apache2_2.4.%.bbappend b/meta-openstack/recipes-httpd/apache2/apache2_2.4.%.bbappend
index 7af8143..5fc832d 100644
--- a/meta-openstack/recipes-httpd/apache2/apache2_2.4.%.bbappend
+++ b/meta-openstack/recipes-httpd/apache2/apache2_2.4.%.bbappend
@@ -1,13 +1,14 @@
 do_install_append() {
     sed -i -e 's/#ServerName.*$/ServerName 127.0.0.1:80/' ${D}${sysconfdir}/apache2/httpd.conf
+    # Keep our logs together, also matches ubuntu and debian
+    sed -i -e 's@^\(.*\)/var/apache2/logs\(.*\)$@\1/var/log/apache2\2 at g' ${D}${sysconfdir}/apache2/httpd.conf
 
     # default layout for htdocsdir in 2.4.7 is different, create the following for
     # backward compatibility reasons
 
     mkdir -p ${D}${datadir}/${BPN}/default-site
     ln -sf ../htdocs ${D}${datadir}/${BPN}/default-site/htdocs
-    
-    sed -i '30i if [ ! -e /var/log/apache2 ]; then ln -sf /var/apache2/logs/ /var/log/apache2; fi' ${D}/etc/init.d/apache2
 }
 
 FILES_${PN} += "${datadir}/${BPN}/default-site"
+SYSTEMD_AUTO_ENABLE_${PN} = "enable"
-- 
2.7.4



More information about the meta-virtualization mailing list