[arch-projects] [RFC] [PATCH] [initscripts] chmod dmesg.log based on value from dmesg_restrict

Gerardo Exequiel Pozzi vmlinuz386 at yahoo.com.ar
Tue May 3 02:11:08 EDT 2011


Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386 at yahoo.com.ar>
---
 rc.sysinit |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/rc.sysinit b/rc.sysinit
index e07afe6..55b3d53 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -371,6 +371,13 @@ fi
 # Set console font if required
 set_consolefont
 
+if [[ -e /proc/sys/kernel/dmesg_restrict && $(< /proc/sys/kernel/dmesg_restrict) -eq 1 ]]; then
+    : >| /var/log/dmesg.log
+    chmod 600 /var/log/dmesg.log
+else
+    : >| /var/log/dmesg.log
+    chmod 644 /var/log/dmesg.log
+fi
 /bin/dmesg >| /var/log/dmesg.log
 
 run_hook sysinit_end
-- 
1.7.5



More information about the arch-projects mailing list