ISC - logging kernel messages

Peter Jannesen peter at ncsbv.UUCP
Sat Jun 22 21:15:30 AEST 1991


In article <7685 at cactus.org> statham at cactus.org (Perry L. Statham) writes:
>Does anyone out there in UnixLand know how to get the kernel 
>of Interactive 386/ix Unix 3.2 to log it's error messages to
>a file or pipe?

Install Operating System Message in the kernel (using kconfig ADD FACILITY).
After you build and rebooted the system there is a new device called /dev/osm.
Kernal message sended to the console are also sended to /dev/osm os do
a simple 'cat /dev/osm >errorlogfile &' and all messages are going also
to errorlogfile.

A simple shell script to include in /etc/rc2.d doing this on system boot:

#ident	"@(#)syslog	1.0 - 91/06/19"

LOGFILE=/usr/spool/log/syslog

#	syslog control
case $1 in
'start')
	set `who -r`
	if [ $9 = "S" ]
	then
		echo System started at: `date` >>$LOGFILE
		cat /dev/osm >>$LOGFILE &
	fi
	;;
'stop')
	/bin/ps -ef | grep 'cat /dev/osm' | grep -v grep | while read d1 pid d2
	do
		if [ "${pid}" != "" ]
		then
			/bin/kill ${pid}
		fi
	done
	;;
*)
	echo "usage: /etc/init.d/syslog {start|stop}"
	;;
esac

===============================================================================
Peter Jannesen
Network Communication Systems (N.C.S), The Netherlands
Phone:  +31104130093				 Fax:    +31104146452
Address: Westbaak 96a                            Email:  peter at ncs.nl
	 3012 KM Rotterdam, The Netherlands
===============================================================================



More information about the Comp.unix.admin mailing list