summaryrefslogtreecommitdiff
path: root/rc.sysinit
diff options
context:
space:
mode:
authorGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2011-05-03 03:04:44 -0300
committerGerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>2011-06-04 21:37:33 -0300
commit6e3ce6f9776d954091deba38ef3b45c4cf4a03db (patch)
tree3193f740425ac9cb6098f46c19e105dd7aa8c80b /rc.sysinit
parent17f7e7483e46a68e2b4cea6cc76216b92370c5e3 (diff)
[initscripts] chmod dmesg.log based on value from dmesg_restrict
Signed-off-by: Gerardo Exequiel Pozzi <vmlinuz386@yahoo.com.ar>
Diffstat (limited to 'rc.sysinit')
-rwxr-xr-xrc.sysinit7
1 files changed, 7 insertions, 0 deletions
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