NetBSD Problem Report #15629

Received: (qmail 14949 invoked from network); 16 Feb 2002 07:39:33 -0000
Message-Id: <>
Date: Sat, 16 Feb 2002 00:38:15 -0600 (CST)
From: seebs <>
Subject: Spotting configuration changes
X-Send-Pr-Version: 3.95

>Number:         15629
>Category:       misc
>Synopsis:       Wouldn't it be nice if you got notified at boot about changes?
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sat Feb 16 07:40:00 +0000 2002
>Last-Modified:  Sat Jun 16 06:24:15 +0000 2012
>Originator:     seebs
>Release:        NetBSD 1.5ZA
System: NetBSD 1.5ZA NetBSD 1.5ZA (GED) #0: Sat Feb 16 00:05:37 CST 2002 i386
Architecture: i386
Machine: i386
	BSD/OS has this cool feature where it says things like "Configuration
	changed:" followed by diffs showing any changes in dmesg output.  This
	can be very handy when debugging.

	At the same time, there's also a /var/db/dmesg.boot showing what the
	system's boot-time configuration was like.

	Boot a system.  :)


Save this script as /sbin/chkconfig.  In /etc/rc, right near the end, add:
echo "Checking system configuration..."


I put it before the 'date' at the end.

This script is structurally fairly similar to the BSD/OS chkconfig, and in
particular, that's where I got the idea for the sed script.

The chkconfig man page is pretty trivial, but could be written if there's
any interest.

umask 022

dmesg | sed -n -e '/^NetBSD/ { x ; n ; }' -e 'H' -e '$ { x ; p ; }' > $new

if	[ ! -f $old ]
then	echo >&2 "No old configuration to compare with."
	cp $new $old
	exit 1

diff $old $new > $out
if	[ -s $out ]
then	echo >&2 "Configuration changed:"
	cat $out
else	R=0
cp $new $old
rm -f $new $out
exit $R
Responsible-Changed-From-To: netbsd-admin->lukem 
Responsible-Changed-By: fair 
Responsible-Changed-When: Fri Feb 15 23:59:22 PST 2002 
1. "admin" is for NetBSD Project Server operations problems. 
2. lukem did our rc scripts. 
Responsible-Changed-From-To: lukem->misc-bug-people
Responsible-Changed-When: Sat, 16 Jun 2012 06:24:15 +0000


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD:,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.