1 |
commit: c5fb64d61f1462d0f8790838424722e161ba4024 |
2 |
Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Sep 27 16:15:08 2011 +0000 |
4 |
Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Sep 27 16:15:08 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=c5fb64d6 |
7 |
|
8 |
Make dmesg log optional |
9 |
|
10 |
Reported-by: Patrick <gentoo <AT> feystorm.net> |
11 |
X-Gentoo-Bug: 384485 |
12 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/384485 |
13 |
|
14 |
--- |
15 |
conf.d/bootmisc | 4 ++++ |
16 |
init.d/bootmisc.in | 13 ++++++++----- |
17 |
2 files changed, 12 insertions(+), 5 deletions(-) |
18 |
|
19 |
diff --git a/conf.d/bootmisc b/conf.d/bootmisc |
20 |
index 2c1670b..d79706c 100644 |
21 |
--- a/conf.d/bootmisc |
22 |
+++ b/conf.d/bootmisc |
23 |
@@ -4,3 +4,7 @@ clean_tmp_dirs="/tmp" |
24 |
# Should we wipe the tmp paths completely or just selectively remove known |
25 |
# locks / files / etc... ? |
26 |
wipe_tmp="YES" |
27 |
+ |
28 |
+# Write the initial dmesg log into /var/log/dmesg after boot |
29 |
+# This may be useful if you need the kernel boot log afterwards |
30 |
+log_dmesg="YES" |
31 |
|
32 |
diff --git a/init.d/bootmisc.in b/init.d/bootmisc.in |
33 |
index 6607f45..2ca7926 100644 |
34 |
--- a/init.d/bootmisc.in |
35 |
+++ b/init.d/bootmisc.in |
36 |
@@ -16,6 +16,7 @@ dir_writeable() |
37 |
} |
38 |
|
39 |
: ${wipe_tmp:=${WIPE_TMP:-yes}} |
40 |
+: ${log_dmesg:=${LOG_DMESG:-yes}} |
41 |
|
42 |
cleanup_tmp_dir() |
43 |
{ |
44 |
@@ -142,11 +143,13 @@ start() |
45 |
fi |
46 |
fi |
47 |
|
48 |
- if $logw || dir_writeable /var/log; then |
49 |
- # Create an 'after-boot' dmesg log |
50 |
- if [ "$RC_SYS" != VSERVER -a "$RC_SYS" != OPENVZ ]; then |
51 |
- dmesg > /var/log/dmesg |
52 |
- chmod 640 /var/log/dmesg |
53 |
+ if yesno $log_dmesg; then |
54 |
+ if $logw || dir_writeable /var/log; then |
55 |
+ # Create an 'after-boot' dmesg log |
56 |
+ if [ "$RC_SYS" != VSERVER -a "$RC_SYS" != OPENVZ ]; then |
57 |
+ dmesg > /var/log/dmesg |
58 |
+ chmod 640 /var/log/dmesg |
59 |
+ fi |
60 |
fi |
61 |
fi |