]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
do not symlink /var/log to /run/log
authorHarald Hoyer <harald@redhat.com>
Mon, 1 Dec 2014 11:36:20 +0000 (12:36 +0100)
committerHarald Hoyer <harald@redhat.com>
Mon, 1 Dec 2014 11:36:20 +0000 (12:36 +0100)
some programs e.g. systemd-journald expect a directory in /var/log as
the marker to do some actions. Here journald tries to flush
/run/log/journal to /var/log/journal, if the directory is seen.

/var/log is now a symlink to /run/initramfs/log.

dracut.sh
modules.d/98systemd/dracut-tmpfiles.conf [new file with mode: 0644]
modules.d/98systemd/module-setup.sh
modules.d/99base/dracut-lib.sh

index 2357987cd69f60e6420ceab2196da54bd5946e31..a542f33aa10cd4c0f01bfe421ba46f2c55e854da 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1300,7 +1300,6 @@ if [[ $kernel_only != yes ]]; then
 
     ln -sfn ../run "$initdir/var/run"
     ln -sfn ../run/lock "$initdir/var/lock"
-    ln -sfn ../run/log "$initdir/var/log"
 else
     for d in lib "$libdir"; do
         [[ -e "${initdir}${prefix}/$d" ]] && continue
diff --git a/modules.d/98systemd/dracut-tmpfiles.conf b/modules.d/98systemd/dracut-tmpfiles.conf
new file mode 100644 (file)
index 0000000..3c21ce8
--- /dev/null
@@ -0,0 +1,3 @@
+d /run/initramfs     0755 root root -
+d /run/initramfs/log 0755 root root -
+L /var/log           -    -    -    - ../run/initramfs/log
index bd4433e008021878a5dcf8d51e3cb915443c2143..8052984c08bb339af0fb40cb454462f13f3e6833 100755 (executable)
@@ -123,6 +123,8 @@ install() {
         $systemdsystemunitdir/slices.target \
         $systemdsystemunitdir/system.slice \
         \
+        $tmpfilesdir/systemd.conf \
+        \
         journalctl systemctl echo swapoff systemd-cgls systemd-tmpfiles
 
     inst_multiple -o \
@@ -232,6 +234,9 @@ install() {
         ln_r "$systemdsystemunitdir/${i}" "$systemdsystemunitdir/initrd.target.wants/${i}"
     done
 
+    inst_simple "$moddir/dracut-tmpfiles.conf" "$tmpfilesdir/dracut-tmpfiles.conf"
+
+
     mkdir -p "$initdir/etc/systemd"
     # turn off RateLimit for journal
     {
index 8bc6b2674c14dd3a82115cc4c582c990bab4b99d..0a89cc8ee9c4dd4d5d1e855a3654bcf5a3526a76 100755 (executable)
@@ -6,7 +6,11 @@ if [ -n "$NEWROOT" ]; then
     [ -d $NEWROOT ] || mkdir -p -m 0755 $NEWROOT
 fi
 
-[ -d /run/initramfs ] || mkdir -p -m 0755 /run/initramfs
+if ! [ -d /run/initramfs ]; then
+    mkdir -p -m 0755 /run/initramfs/log
+    ln -sfn /run/initramfs/log /var/log
+fi
+
 [ -d /run/lock ] || mkdir -p -m 0755 /run/lock
 [ -d /run/log ] || mkdir -p -m 0755 /run/log