From: SANJIB D. <san...@ya...> - 2005-01-18 12:27:20
|
Hello, I have few queries regarding kernel messages... A) There are two services, or daemons, that control logging, klogd and syslogd. klogd only deals with kernel messages. syslogd deals with other system messages, such as applications. Syslog can handle messages from the kernel itself. But the kernel doesn't write to `/dev/log'; rather, another daemon (sometimes called "Klogd") extracts messages from the kernel and passes them on to Syslog as any other process would (and it properly identifies them as messages from the kernel). By kernel message do we mean only those messages whose facility is kernel,..right? Moreover, The klogd daemon also allows the ability to alter the pre­sentation of kernel messages to the system console depending on the the default console log level which is set to 7(which can be changed into the file /proc/sys/kernel/printk). Any messages with a priority level numerically lower than 7 (higher priority) appear on the console. Now my question is the kernel messages(any message having priority level down to 7) which are sent to the console, are also passed to the syslogd? Again, when a message is received from the kernel the klogd daemon reads this priority level and assigns the appropriate priority level to the syslog message(According to The klogd man page).Now whats the priority level the klogd reads from kernel messages? & assigns appropriate priority level before passing to syslogd? Does it change the priority, if so, then why? Please suggest . B) I need to read kernel messages depending on the priority level of the messages.Is it possible to read messages from /proc/kmesg based on their priority.Or can we store messages of particular priority into this file.Please suggest...... C) If I restart the syslogd I get kernel messages like.. Jan 18 17:16:24 iiip0 syslogd 1.4.1: restart. Jan 18 17:16:25 iiip0 syslog: syslogd startup succeeded Jan 18 17:16:25 iiip0 kernel: klogd 1.4.1, log source = /proc/kmsg started. Jan 18 17:16:25 iiip0 kernel: Inspecting /boot/System.map-2.4.7-10 Jan 18 17:16:25 iiip0 syslog: klogd startup succeeded Jan 18 17:16:25 iiip0 kernel: Loaded 15046 symbols from /boot/System.map-2.4.7-10. Jan 18 17:16:25 iiip0 kernel: Symbols match kernel version 2.4.7. Jan 18 17:16:25 iiip0 kernel: Loaded 309 symbols from 11 modules. Jan 18 17:16:24 iiip0 syslog: syslogd shutdown succeeded into /var/log/messages. These messages have the priority level info. But in /proc/kmsg these are absent. My question is why these are absent there? Is there something like messages of all the priority levels are not stored into /proc/kmsg? Please suggest ? thanks & regards Sanjeev --------------------------------- Do you Yahoo!? The all-new My Yahoo! Get yours free! |