All of lore.kernel.org
 help / color / mirror / Atom feed
From: "akuster" <akuster808@gmail.com>
To: openembedded-devel@lists.openembedded.org
Cc: Changqing Li <changqing.li@windriver.com>, Khem Raj <raj.khem@gmail.com>
Subject: [dunfell][PATCH 15/18] apache2: fix service start fail
Date: Tue, 19 May 2020 07:43:29 -0700	[thread overview]
Message-ID: <20200519144332.12822-15-akuster808@gmail.com> (raw)
In-Reply-To: <20200519144332.12822-1-akuster808@gmail.com>

From: Changqing Li <changqing.li@windriver.com>

reproduce steps:
1. boot up target
2. scp apache2-2.4.41-r0.1.aarch64.rpm on target
3. rpm -i apache2-2.4.41-r0.1.aarch64.rpm
4. systemctl status apache2

Error:
httpd[7767]: (2)No such file or directory: AH02291: Cannot access directory '/var/log/apache2/' for main error log

with the old way, /var/log/apache2/ is created by service
systemd-tmpfiles-setup during boot, so only works when apache2
already installed before boot, in above scenario,
/var/log/apache2/ will not created. fix by creating it in the
service file. similar fix for sysV system

Signed-off-by: Changqing Li <changqing.li@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit e789c3837ca8d65abb4bac29dc2e5c595c8ce05b)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
---
 meta-webserver/recipes-httpd/apache2/apache2_2.4.43.bb    | 8 --------
 .../recipes-httpd/apache2/files/apache2-volatile.conf     | 2 --
 .../recipes-httpd/apache2/files/apache2.service           | 4 ++++
 meta-webserver/recipes-httpd/apache2/files/init           | 5 +++++
 .../recipes-httpd/apache2/files/volatiles.04_apache2      | 3 ---
 5 files changed, 9 insertions(+), 13 deletions(-)
 delete mode 100644 meta-webserver/recipes-httpd/apache2/files/apache2-volatile.conf
 delete mode 100644 meta-webserver/recipes-httpd/apache2/files/volatiles.04_apache2

diff --git a/meta-webserver/recipes-httpd/apache2/apache2_2.4.43.bb b/meta-webserver/recipes-httpd/apache2/apache2_2.4.43.bb
index 5200111520..9b80bbff67 100644
--- a/meta-webserver/recipes-httpd/apache2/apache2_2.4.43.bb
+++ b/meta-webserver/recipes-httpd/apache2/apache2_2.4.43.bb
@@ -20,9 +20,7 @@ SRC_URI = "${APACHE_MIRROR}/httpd/httpd-${PV}.tar.bz2 \
 SRC_URI_append_class-target = " \
            file://0008-apache2-do-not-use-relative-path-for-gen_test_char.patch \
            file://init \
-           file://apache2-volatile.conf \
            file://apache2.service \
-           file://volatiles.04_apache2 \
            "
 
 LIC_FILES_CHKSUM = "file://LICENSE;md5=bddeddfac80b2c9a882241d008bb41c3"
@@ -128,16 +126,10 @@ do_install_append_class-target() {
            -e 's,".*/configure","configure",g' ${D}${datadir}/apache2/build/config.nice
 
     if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
-        install -d ${D}${sysconfdir}/tmpfiles.d/
-        install -m 0644 ${WORKDIR}/apache2-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
-
         install -d ${D}${systemd_unitdir}/system
         install -m 0644 ${WORKDIR}/apache2.service ${D}${systemd_unitdir}/system
         sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/apache2.service
         sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/apache2.service
-    elif ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
-        install -d ${D}${sysconfdir}/default/volatiles
-        install -m 0644 ${WORKDIR}/volatiles.04_apache2 ${D}${sysconfdir}/default/volatiles/04_apache2
     fi
 
     rm -rf ${D}${localstatedir} ${D}${sbindir}/envvars*
diff --git a/meta-webserver/recipes-httpd/apache2/files/apache2-volatile.conf b/meta-webserver/recipes-httpd/apache2/files/apache2-volatile.conf
deleted file mode 100644
index ff2c587046..0000000000
--- a/meta-webserver/recipes-httpd/apache2/files/apache2-volatile.conf
+++ /dev/null
@@ -1,2 +0,0 @@
-d  /var/run/apache2 0755 root root -
-d  /var/log/apache2 0755 root root -
diff --git a/meta-webserver/recipes-httpd/apache2/files/apache2.service b/meta-webserver/recipes-httpd/apache2/files/apache2.service
index 9b5548c761..25d43acf8e 100644
--- a/meta-webserver/recipes-httpd/apache2/files/apache2.service
+++ b/meta-webserver/recipes-httpd/apache2/files/apache2.service
@@ -5,6 +5,10 @@ After=network.target remote-fs.target nss-lookup.target
 [Service]
 Type=simple
 Environment=LANG=C
+ExecStartPre=mkdir -p /var/log/apache2
+ExecStartPre=mkdir -p /var/run/apache2
+ExecStartPre=chmod -R 0755 /var/log/apache2
+ExecStartPre=chmod -R 0755 /var/run/apache2
 ExecStart=@SBINDIR@/httpd -DFOREGROUND -D SSL -D PHP5 -k start
 ExecStop=@BASE_BINDIR@/kill -WINCH ${MAINPID}
 KillSignal=SIGCONT
diff --git a/meta-webserver/recipes-httpd/apache2/files/init b/meta-webserver/recipes-httpd/apache2/files/init
index 758d133b9e..80a7ebfcb2 100644
--- a/meta-webserver/recipes-httpd/apache2/files/init
+++ b/meta-webserver/recipes-httpd/apache2/files/init
@@ -97,6 +97,11 @@ do_start()
             return 1
     fi
 
+    mkdir -p /var/log/apache2
+    chmod -R 0755 /var/log/apache2
+    mkdir -p /var/run/apache2
+    chmod -R 0755 /var/run/apache2
+
     if apache_conftest ; then
             $APACHECTL start
             apache_wait_start $?
diff --git a/meta-webserver/recipes-httpd/apache2/files/volatiles.04_apache2 b/meta-webserver/recipes-httpd/apache2/files/volatiles.04_apache2
deleted file mode 100644
index 922075b1bd..0000000000
--- a/meta-webserver/recipes-httpd/apache2/files/volatiles.04_apache2
+++ /dev/null
@@ -1,3 +0,0 @@
-# <type> <owner> <group> <mode> <path> <linksource>
-d root root 0755 /var/run/apache2 none
-d root root 0755 /var/log/apache2 none
-- 
2.17.1


  parent reply	other threads:[~2020-05-19 14:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-19 14:43 [dunfell][PATCH 01/18] mraa: Replace -fcommon with fix akuster
2020-05-19 14:43 ` [dunfell][PATCH 02/18] v4l-utils: upgrade 1.18.0 -> 1.18.1 akuster
2020-05-19 14:43 ` [dunfell][PATCH 03/18] cpprest: upgrade 2.10.15 -> 2.10.16 akuster
2020-05-19 14:43 ` [dunfell][PATCH 04/18] python3-pyrsistent: add python3-numbers to RDEPENDS akuster
2020-05-19 14:43 ` [dunfell][PATCH 05/18] python3-pytoml: add datetime and stringold " akuster
2020-05-19 14:43 ` [dunfell][PATCH 06/18] python3-dbusmock: re-add recipe and fix patch path akuster
2020-05-19 14:43 ` [dunfell][PATCH 07/18] python3-pyyaml: add python3-netclient to RDEPENDS akuster
2020-05-19 14:43 ` [dunfell][PATCH 08/18] python3-werkzeug: add python3-logging " akuster
2020-05-19 14:43 ` [dunfell][PATCH 09/18] multipath-tools: upgrade 0.8.3 -> 0.8.4 akuster
2020-05-19 14:43 ` [dunfell][PATCH 10/18] cpprest: Disable one more test requiring internet connection akuster
2020-05-19 14:43 ` [dunfell][PATCH 11/18] gnome-themes-extra: correct the recipe name akuster
2020-05-19 18:00   ` [oe] " Adrian Bunk
2020-05-19 14:43 ` [dunfell][PATCH 12/18] gtkwave: Disable mime update during install akuster
2020-05-19 14:43 ` [dunfell][PATCH 13/18] modemmanager: upgrade 1.12.8 -> 1.12.10 akuster
2020-05-19 14:43 ` [dunfell][PATCH 14/18] python3-pyroute2: upgrade 0.5.11 -> 0.5.12 akuster
2020-05-19 14:43 ` akuster [this message]
2020-05-19 14:43 ` [dunfell][PATCH 16/18] appstream-glib: update 0.7.16 -> 0.7.17 akuster
2020-05-19 14:43 ` [dunfell][PATCH 17/18] libldb: upgrade 1.5.6 -> 1.5.7 akuster
2020-05-19 14:43 ` [dunfell][PATCH 18/18] samba: upgrade 4.10.13 -> 4.10.15 akuster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200519144332.12822-15-akuster808@gmail.com \
    --to=akuster808@gmail.com \
    --cc=changqing.li@windriver.com \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=raj.khem@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.