source: udev/README.Logging@ 44d357b

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 44d357b was 7e161ea, checked in by Jim Gifford <clfs@…>, 19 years ago

r833@server (orig r831): jim | 2005-12-05 10:42:24 -0800
Added: udev package for Cross-LFS. Work in Progress

  • Property mode set to 100644
File size: 2.9 KB
RevLine 
[7e161ea]1How to watch udev activity when booting
2#######################################
3
4
51) Make syslog start before udev:
6^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
7Since udev writes all output to syslog, we need service syslog running before
8udevd starts. There are two ways to achieve this.
9
10Either 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
12Or you edit the service scripts itself and let insserv create the links. You
13have 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
21Then call
22 /sbin/insserv -d earlysyslog
23Check if earlysyslog comes before boot.udev in /etc/init.d/boot.d/S*
24
25You need /var on your root partition for that because boot.localfs is started
26after udev. If you have a seperate /var partition, make it available somehow or
27change the location of your syslog file.
28
29
302) Enable logging
31^^^^^^^^^^^^^^^^^
32set udev_log=info in /etc/udev/udev.conf.
33
34There is also debug, but you are very
35probably not interested in the huge amount of debugging output from udev. It
36writes about 70M logfile at a single boot.
37
38Many tools which are called from hotplug also respect the setting of udev_log.
39But there might be some which need special actions to make them verbose.
40[to be enhanced: list tools and their individual debug switches]
41
42You may change udevs loglevel at runtime with
43 udevcontrol log_priority=<level>
44
45
463) Reboot
47^^^^^^^^^
48For further processing of the logging output you should get a clean logfile at
49next boot. Just move the old logfile away. Syslog will still use the moved file
50until shutdown (until syslog restarted).
51mv /var/log/messages /var/log/messages.`date +%s`
52
53Then reboot.
54
55
564) Getting logged events sorted
57^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
58There 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
68If you don't use /var/log/messages as lockfile you may set the environment
69variable MESSAGES=<logfile>.
70
71The script is slowly. It is just a quick hack. The larger the syslog file the
72slower the script. Therefore always boot with a fresh logfile.
73Improvements are welcome.
74
75
76Have a lot of fun, as always ;)
77
Note: See TracBrowser for help on using the repository browser.