NetBSD Problem Report #15629

Received: (qmail 14949 invoked from network); 16 Feb 2002 07:39:33 -0000
Message-Id: <200202160638.g1G6cFU00566@ged.plethora.net>
Date: Sat, 16 Feb 2002 00:38:15 -0600 (CST)
From: seebs <seebs@ged.plethora.net>
Reply-To: seebs@ged.plethora.net
To: gnats-bugs@gnats.netbsd.org
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
>Closed-Date:    
>Last-Modified:  Sat Jun 16 06:24:15 +0000 2012
>Originator:     seebs
>Release:        NetBSD 1.5ZA
>Organization:
	N/A
>Environment:
System: NetBSD ged.plethora.net 1.5ZA NetBSD 1.5ZA (GED) #0: Sat Feb 16 00:05:37 CST 2002 seebs@ged.plethora.net:/usr/src/sys/arch/i386/compile/GED i386
Architecture: i386
Machine: i386
>Description:
	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.

>How-To-Repeat:
	Boot a system.  :)

>Fix:

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

---

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.

#!/bin/sh
umask 022
old=/var/db/dmesg.boot
new=/tmp/ck$$.dmesg
out=/tmp/ck$$.out

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
fi

diff $old $new > $out
if	[ -s $out ]
then	echo >&2 "Configuration changed:"
	cat $out
	R=1
else	R=0
fi
cp $new $old
rm -f $new $out
exit $R
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: netbsd-admin->lukem 
Responsible-Changed-By: fair 
Responsible-Changed-When: Fri Feb 15 23:59:22 PST 2002 
Responsible-Changed-Why:  
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-By: lukem@NetBSD.org
Responsible-Changed-When: Sat, 16 Jun 2012 06:24:15 +0000
Responsible-Changed-Why:
.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

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