1 | How to watch udev activity when booting |
---|
2 | ####################################### |
---|
3 | |
---|
4 | |
---|
5 | 1) Make syslog start before udev: |
---|
6 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
---|
7 | Since udev writes all output to syslog, we need service syslog running before |
---|
8 | udevd starts. There are two ways to achieve this. |
---|
9 | |
---|
10 | Either add the needed link to /etc/init.d/earlysyslog in /etc/init.d/boot.d/ manually. But it must start later then boot.rootfsck. |
---|
11 | |
---|
12 | Or you edit the service scripts itself and let insserv create the links. You |
---|
13 | have to change earlysyslog and boot.udev: |
---|
14 | /etc/init.d/earlysyslog |
---|
15 | Add 'B' to 'Default-Start:' and 'boot.rootfsck' to 'Required-Start:' |
---|
16 | # Required-Start: boot.rootfsck |
---|
17 | # Default-Start: B 2 3 5 |
---|
18 | /etc/init.d/boot.udev |
---|
19 | Add 'earlysyslog' to 'Required-Start' |
---|
20 | # Required-Start: boot.rootfsck earlysyslog |
---|
21 | Then call |
---|
22 | /sbin/insserv -d earlysyslog |
---|
23 | Check if earlysyslog comes before boot.udev in /etc/init.d/boot.d/S* |
---|
24 | |
---|
25 | You need /var on your root partition for that because boot.localfs is started |
---|
26 | after udev. If you have a seperate /var partition, make it available somehow or |
---|
27 | change the location of your syslog file. |
---|
28 | |
---|
29 | |
---|
30 | 2) Enable logging |
---|
31 | ^^^^^^^^^^^^^^^^^ |
---|
32 | set udev_log=info in /etc/udev/udev.conf. |
---|
33 | |
---|
34 | There is also debug, but you are very |
---|
35 | probably not interested in the huge amount of debugging output from udev. It |
---|
36 | writes about 70M logfile at a single boot. |
---|
37 | |
---|
38 | Many tools which are called from hotplug also respect the setting of udev_log. |
---|
39 | But there might be some which need special actions to make them verbose. |
---|
40 | [to be enhanced: list tools and their individual debug switches] |
---|
41 | |
---|
42 | You may change udevs loglevel at runtime with |
---|
43 | udevcontrol log_priority=<level> |
---|
44 | |
---|
45 | |
---|
46 | 3) Reboot |
---|
47 | ^^^^^^^^^ |
---|
48 | For further processing of the logging output you should get a clean logfile at |
---|
49 | next boot. Just move the old logfile away. Syslog will still use the moved file |
---|
50 | until shutdown (until syslog restarted). |
---|
51 | mv /var/log/messages /var/log/messages.`date +%s` |
---|
52 | |
---|
53 | Then reboot. |
---|
54 | |
---|
55 | |
---|
56 | 4) Getting logged events sorted |
---|
57 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
---|
58 | There is a script 'show_event_log' which may be used to extract info out of |
---|
59 | /var/log/messages. Call it |
---|
60 | show_event_log <first> [<last> [<list of event types>] ] |
---|
61 | <first> is the sequence number of the first event you are interested in. |
---|
62 | <last> is the number of the last event. You may write 'last' literally. It may |
---|
63 | also be omitted if you want to see a single event. |
---|
64 | <list> is a list of event types you like to see. If you omit it, you get most |
---|
65 | events, not all. Some are exclude by default. Use " " as list if you |
---|
66 | want to see really all. Or edit the list of skipped events in the first |
---|
67 | lines of the script |
---|
68 | If you don't use /var/log/messages as lockfile you may set the environment |
---|
69 | variable MESSAGES=<logfile>. |
---|
70 | |
---|
71 | The script is slowly. It is just a quick hack. The larger the syslog file the |
---|
72 | slower the script. Therefore always boot with a fresh logfile. |
---|
73 | Improvements are welcome. |
---|
74 | |
---|
75 | |
---|
76 | Have a lot of fun, as always ;) |
---|
77 | |
---|