diff options
author | Changqing Li <changqing.li@windriver.com> | 2020-05-14 16:03:56 +0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2020-05-14 10:43:48 -0700 |
commit | e789c3837ca8d65abb4bac29dc2e5c595c8ce05b (patch) | |
tree | 7ef30015c8db90b1d1a2303781abf1f1201c28e2 /meta-webserver/recipes-httpd/apache2/files/init | |
parent | 337094167094536a40d94d3ee74e6355d8fbf2dd (diff) | |
download | meta-openembedded-contrib-e789c3837ca8d65abb4bac29dc2e5c595c8ce05b.tar.gz |
apache2: fix service start fail
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>
Diffstat (limited to 'meta-webserver/recipes-httpd/apache2/files/init')
-rw-r--r-- | meta-webserver/recipes-httpd/apache2/files/init | 5 |
1 files changed, 5 insertions, 0 deletions
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 $? |