aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Nykryn <lnykryn@redhat.com>2013-08-30 14:34:32 +0200
committerLukas Nykryn <lnykryn@redhat.com>2013-08-30 14:40:31 +0200
commit2769dbcf9daa7a661b4b00de9f0d1c8d2605b1c7 (patch)
treeb93b8c075321a46bea0421120ccd249ab10e2e24
parent9ae13cd207aa26dea9d399d824a2f4bf57a9086c (diff)
downloadinitscripts-2769dbcf9daa7a661b4b00de9f0d1c8d2605b1c7.tar
initscripts-2769dbcf9daa7a661b4b00de9f0d1c8d2605b1c7.tar.gz
initscripts-2769dbcf9daa7a661b4b00de9f0d1c8d2605b1c7.tar.bz2
initscripts-2769dbcf9daa7a661b4b00de9f0d1c8d2605b1c7.tar.xz
initscripts-2769dbcf9daa7a661b4b00de9f0d1c8d2605b1c7.zip
create /var/log/dmesg for compatibility reasons (#854002)
-rw-r--r--Makefile1
-rwxr-xr-xsystemd/rhel-dmesg3
-rw-r--r--systemd/system/rhel-dmesg.service11
3 files changed, 15 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index ee4fee52..0a8d75b1 100644
--- a/Makefile
+++ b/Makefile
@@ -95,6 +95,7 @@ install:
ln -s ../rhel-loadmodules.service $(ROOT)/usr/lib/systemd/system/basic.target.wants
ln -s ../rhel-autorelabel.service $(ROOT)/usr/lib/systemd/system/basic.target.wants
ln -s ../rhel-autorelabel-mark.service $(ROOT)/usr/lib/systemd/system/basic.target.wants
+ ln -s ../rhel-dmesg.service $(ROOT)/usr/lib/systemd/system/basic.target.wants
ln -s ../rhel-readonly.service $(ROOT)/usr/lib/systemd/system/local-fs.target.wants
ln -s ../rhel-import-state.service $(ROOT)/usr/lib/systemd/system/local-fs.target.wants
diff --git a/systemd/rhel-dmesg b/systemd/rhel-dmesg
new file mode 100755
index 00000000..4c7f1510
--- /dev/null
+++ b/systemd/rhel-dmesg
@@ -0,0 +1,3 @@
+#!/bin/bash
+[ -f /var/log/dmesg ] && mv -f /var/log/dmesg /var/log/dmesg.old
+dmesg -s 131072 > /var/log/dmesg
diff --git a/systemd/system/rhel-dmesg.service b/systemd/system/rhel-dmesg.service
new file mode 100644
index 00000000..ad5ae1cb
--- /dev/null
+++ b/systemd/system/rhel-dmesg.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Dump dmesg to /var/log/dmesg
+After=basic.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/lib/systemd/rhel-dmesg
+RemainAfterExit=yes
+
+[Install]
+WantedBy=basic.target