Skip to contentSkip to conversation

Redefine libexecdir to fix apache2

PATCH New [email protected] 1 participant 3 messages Sep 5, 2019

lore
Share & tools
lore
#0 lore raw

cover Redefine libexecdir to fix apache2

From: Kai Kang <[email protected]>

Build with
1 echo 'IMAGE_INSTALL_append = " apache2"' >>conf/local.conf 2 bitbake core-image-sato-sdk
3 runqemu qemumips64 nographic

root@qemumips64:~# systemctl status apache2
* apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-09-05 22:29:59 UTC; 45s ago
 Main PID: 178 (httpd)
    Tasks: 82 (limit: 546)
   Memory: 7.0M
   CGroup: /system.slice/apache2.service
           |-178 /usr/sbin/httpd -DFOREGROUND -D SSL -D PHP5 -k start
           |-192 /usr/sbin/httpd -DFOREGROUND -D SSL -D PHP5 -k start
           |-193 /usr/sbin/httpd -DFOREGROUND -D SSL -D PHP5 -k start
           `-194 /usr/sbin/httpd -DFOREGROUND -D SSL -D PHP5 -k start
Sep 05 22:29:59 qemumips64 systemd[1]: Started The Apache HTTP Server.
root@qemumips64:~# systemctl stop apache2
root@qemumips64:~# systemctl status apache2
* apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Thu 2019-09-05 22:30:56 UTC; 4s ago
  Process: 178 ExecStart=/usr/sbin/httpd -DFOREGROUND -D SSL -D PHP5 -k start (code=exited, status=0/SUCCESS)
  Process: 341 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
 Main PID: 178 (code=exited, status=0/SUCCESS)
Sep 05 22:29:59 qemumips64 systemd[1]: Started The Apache HTTP Server.
Sep 05 22:30:51 qemumips64 systemd[1]: Stopping The Apache HTTP Server...
Sep 05 22:30:56 qemumips64 systemd[1]: apache2.service: Succeeded.
Sep 05 22:30:56 qemumips64 systemd[1]: Stopped The Apache HTTP Server.
root@qemumips64:~# systemctl start apache2
root@qemumips64:~# systemctl status apache2
* apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2019-09-05 22:31:15 UTC; 2s ago
 Main PID: 348 (httpd)
    Tasks: 82 (limit: 546)
   Memory: 5.2M
   CGroup: /system.slice/apache2.service
           |-348 /usr/sbin/httpd -DFOREGROUND -D SSL -D PHP5 -k start
           |-349 /usr/sbin/httpd -DFOREGROUND -D SSL -D PHP5 -k start
           |-350 /usr/sbin/httpd -DFOREGROUND -D SSL -D PHP5 -k start
           `-351 /usr/sbin/httpd -DFOREGROUND -D SSL -D PHP5 -k start
root@qemumips64:~# curl localhost
<html><body><h1>It works!</h1></body></html>

Kai Kang (2):
apache2: fix multilib file conflicts
php: sync with apache2's change

 meta-oe/recipes-devtools/php/php.inc                   | 6 ++----
 meta-webserver/recipes-httpd/apache2/apache2_2.4.41.bb | 6 +++---
 2 files changed, 5 insertions(+), 7 deletions(-)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/2 apache2: fix multilib file conflicts

From: Kai Kang <[email protected]>

There are errors of apache2 about files conflicts when multilib enabled:

| Error: Transaction check error:
|   file /etc/apache2/extra/httpd-ssl.conf conflicts between attempted installs of lib32-apache2-2.4.41-r0.core2_32 and apache2-2.4.41-r0.core2_64
|   file /etc/apache2/httpd.conf conflicts between attempted installs of lib32-apache2-2.4.41-r0.core2_32 and apache2-2.4.41-r0.core2_64
|   file /usr/sbin/envvars conflicts between attempted installs of lib32-apache2-2.4.41-r0.core2_32 and apache2-2.4.41-r0.core2_64
|   file /usr/sbin/envvars-std conflicts between attempted installs of lib32-apache2-2.4.41-r0.core2_32 and apache2-2.4.41-r0.core2_64

It makes libexecdir point to ${libdir}. Reset to ${libexecdir} which could eliminate file conflicts of the conf files. And remove /usr/sbin/envvars and /usr/sbin/envvars-std which only used by apachectl. They only add standard library path ${libdir} to LD_LIBRARY_PATH, so remove them to avoid multilib file conflicts.

---
 meta-webserver/recipes-httpd/apache2/apache2_2.4.41.bb | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta-webserver/recipes-httpd/apache2/apache2_2.4.41.bb +3 -3
index a8da7e227..a34734c20 100644
@@ -53,7 +53,7 @@ EXTRA_OECONF_class-target = "\
     --sysconfdir=${sysconfdir}/${BPN} \
     --datadir=${datadir}/${BPN} \
     --libdir=${libdir} \
-    --libexecdir=${libdir}/${BPN}/modules \
+    --libexecdir=${libexecdir}/${BPN}/modules \
     --localstatedir=${localstatedir} \
     --enable-ssl \
     --with-dbm=sdbm \
@@ -78,7 +78,7 @@ EXTRA_OECONF_class-native = "\
     "
 
 do_configure_prepend() {
-    sed -i -e 's:$''{prefix}/usr/lib/cgi-bin:$''{libdir}/cgi-bin:g' ${S}/config.layout
+    sed -i -e 's:$''{prefix}/usr/lib/cgi-bin:$''{libexecdir}/cgi-bin:g' ${S}/config.layout
 }
 
 do_install_append_class-target() {
@@ -139,7 +139,7 @@ do_install_append_class-target() {
         install -m 0644 ${WORKDIR}/volatiles.04_apache2 ${D}${sysconfdir}/default/volatiles/04_apache2
     fi
 
-    rm -rf ${D}${localstatedir}
+    rm -rf ${D}${localstatedir} ${D}${sbindir}/envvars*
     chown -R root:root ${D}
 }
 
Signature · 1 line
2.17.1
#2 lore raw

PATCH 2/2 php: sync with apache2's change

In reply to [email protected]

From: Kai Kang <[email protected]>

It redefines apache2's libexecdir. Update php to sync with that change.

---
 meta-oe/recipes-devtools/php/php.inc | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
meta-oe/recipes-devtools/php/php.inc +2 -4
index 4c0617c49..d738d2d93 100644
@@ -172,10 +172,8 @@ do_install_append_class-target() {
     done
 
     if ${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'true', 'false', d)}; then
-        install -d ${D}${libdir}/apache2/modules
         install -d ${D}${sysconfdir}/apache2/modules.d
         install -d ${D}${sysconfdir}/php/apache2-php${PHP_MAJOR_VERSION}
-        install -m 755  libs/libphp${PHP_MAJOR_VERSION}.so ${D}${libdir}/apache2/modules
         install -m 644  ${WORKDIR}/70_mod_php${PHP_MAJOR_VERSION}.conf ${D}${sysconfdir}/apache2/modules.d
         sed -i s,lib/,${libdir}/, ${D}${sysconfdir}/apache2/modules.d/70_mod_php${PHP_MAJOR_VERSION}.conf
         cat ${S}/php.ini-production | \
@@ -211,7 +209,7 @@ INITSCRIPT_PACKAGES = "${PN}-fpm"
 inherit update-rc.d
 
 FILES_${PN}-dbg =+ "${bindir}/.debug \
-                    ${libdir}/apache2/modules/.debug"
+                    ${libexecdir}/apache2/modules/.debug"
 FILES_${PN}-doc += "${PHP_LIBDIR}/php/doc"
 FILES_${PN}-cli = "${bindir}/php"
 FILES_${PN}-phar = "${bindir}/phar*"
@@ -237,7 +235,7 @@ FILES_${PN}-dev = "${includedir}/php ${PHP_LIBDIR}/build ${bindir}/phpize \
 FILES_${PN}-staticdev += "${PHP_LIBDIR}/extensions/*/*.a"
 FILES_${PN}-opcache = "${PHP_LIBDIR}/extensions/*/opcache${SOLIBSDEV}"
 FILES_${PN} = "${PHP_LIBDIR}/php"
-FILES_${PN} += "${bindir}"
+FILES_${PN} += "${bindir} ${libexecdir}/apache2"
 
 SUMMARY_${PN}-modphp = "PHP module for the Apache HTTP server"
 FILES_${PN}-modphp = "${libdir}/apache2 ${sysconfdir}"
Signature · 1 line
2.17.1