Skip to contentSkip to conversation

systemd: Check for directory before chmod'ing it

PATCH New Khem Raj 1 participant 1 message Mar 7, 2024

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 systemd: Check for directory before chmod'ing it

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

Cc Changqing Li <[email protected]>
---
 meta/recipes-core/systemd/systemd_255.4.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-core/systemd/systemd_255.4.bb +1 -1
index d59ca30c12f..bcef3e6b7ac 100644
@@ -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
Signature · 1 line
2.44.0