From 6e3ce6f9776d954091deba38ef3b45c4cf4a03db Mon Sep 17 00:00:00 2001 From: Gerardo Exequiel Pozzi Date: Tue, 3 May 2011 03:04:44 -0300 Subject: [initscripts] chmod dmesg.log based on value from dmesg_restrict Signed-off-by: Gerardo Exequiel Pozzi --- rc.sysinit | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'rc.sysinit') diff --git a/rc.sysinit b/rc.sysinit index 5b58270..84ff4cb 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -368,6 +368,13 @@ for f in cd net; do /bin/cat "/run/udev/tmp-rules--70-persistent-$f.rules" >> "/etc/udev/rules.d/70-persistent-$f.rules" done +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 -- cgit v1.2.3