Sending kernel messages to syslog

Another blog entry prompted by a question in IM.

How to get the kernel to send a message to syslog?

The simplest way is to configure coreadm(1M) to log all core dumps and then run a program that dumps core. Eg:

: estale.eu FSS 6 $; sleep 100000 &
[1]     518123
: estale.eu FSS 7 $; kill -SEGV $!
: estale.eu FSS 8 $; tail -10 /var/adm/messages | grep $!
May 10 11:18:01 estale genunix: [ID 603404 kern.notice] NOTICE: core_log: sleep[518123] core dumped: /var/cores/core.sleep.518123.1115720281.global
[1] + Segmentation Fault(coredump)sleep 100000 &
: estale.eu FSS 9 $; 

If the message does not appear in the messages file you have probably messed up your syslog.conf file.

Technorati Tag: Solaris
Comments:

Post a Comment:
Comments are closed for this entry.
About

This is the old blog of Chris Gerhard. It has mostly moved to http://chrisgerhard.wordpress.com

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today