diff mbox series

systemd: Check for directory before chmod'ing it

Message ID 20240307191031.1556652-1-raj.khem@gmail.com
State Accepted, archived
Commit e017f405bf6ae6c269a8c9c981878fd1ad8666b6
Headers show
Series systemd: Check for directory before chmod'ing it | expand

Commit Message

Khem Raj March 7, 2024, 7:10 p.m. UTC
da9db878a15 systemd: fix dead link /var/log/README
add -Dcreate-log-dirs=false which means journal dir
will not be generated regardless of VOLATILE_LOG_DIR value
if a distro decided to set VOLATILE_LOG_DIR=no this
code path will be executes and the directory being operated
upon wont exist ending in do_install errors

chown: cannot access '/mnt/b/yoe/master/build/tmp/work/riscv64-yoe-linux/systemd/255.4/image/var/log/journal': No such file or directory

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Cc: Changqing Li <changqing.li@windriver.com>
---
 meta/recipes-core/systemd/systemd_255.4.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta/recipes-core/systemd/systemd_255.4.bb b/meta/recipes-core/systemd/systemd_255.4.bb
index d59ca30c12f..bcef3e6b7ac 100644
--- a/meta/recipes-core/systemd/systemd_255.4.bb
+++ b/meta/recipes-core/systemd/systemd_255.4.bb
@@ -306,7 +306,7 @@  do_install() {
 		# /var/log is typically a symbolic link to inside /var/volatile,
 		# which is expected to be empty.
 		rm -rf ${D}${localstatedir}/log
-	else
+	elif [ -e ${D}${localstatedir}/log/journal ]; then
 		chown root:systemd-journal ${D}${localstatedir}/log/journal
 
 		# journal-remote creates this at start