]> 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>
Thu, 2 Apr 2015 14:11:31 +0000 (16:11 +0200)
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.

(cherry picked from commit 99d4fd6bb791ca8ce07e07e13b58445f3e20894a)

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 74c59a0c45b2d0a7db3291e49d233a2e4c217480..27c2bf45f5083cf68726419deaf7c4c2fd9bc9fe 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -1217,7 +1217,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 f62f5511421748c1bd4bab34811bad1112974021..aae0319a813e145ad2405eb0bf74b821ec80440b 100755 (executable)
@@ -121,6 +121,8 @@ install() {
         $systemdsystemunitdir/slices.target \
         $systemdsystemunitdir/system.slice \
         \
+        $tmpfilesdir/systemd.conf \
+        \
         journalctl systemctl echo swapoff systemd-cgls systemd-tmpfiles
 
     inst_multiple -o \
@@ -230,6 +232,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 b0ac08a048b2ae9dcb566cf8fc0de2859fbf11e3..b490e8241eb4194bca8f971964564f81ad0f7284 100755 (executable)
@@ -4,6 +4,17 @@
 
 export DRACUT_SYSTEMD
 export NEWROOT
+if [ -n "$NEWROOT" ]; then
+    [ -d $NEWROOT ] || mkdir -p -m 0755 $NEWROOT
+fi
+
+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
 
 debug_off() {
     set +x