Subject: bin/31074: /etc/security now too verbose with newer iostat
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <gcw@primenet.com.au>
List: netbsd-bugs
Date: 08/26/2005 02:57:00
>Number:         31074
>Category:       bin
>Synopsis:       iostat tape warning not useful in /etc/security and prevents report suppression
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Aug 26 02:57:00 +0000 2005
>Originator:     Geoff C. Wing
>Release:        NetBSD 3.99.8
>Organization:
>Environment:
System: NetBSD g.primenet.com.au 3.99.8 NetBSD 3.99.8 (G) #0: Fri Aug 26 11:12:15 EST 2005 gcw@g.primenet.com.au:/usr/netbsd/src/sys/arch/i386/compile/G i386
Architecture: i386
Machine: i386
>Description:
	iostat spews out "iostat: No tape drives attached." when no tape
	drives are attached (obviously).  This information is useless
	in the context iostat is called in /etc/security (*).  Furthermore
	this information prevents /etc/daily from suppressing the
	/etc/security mail.  

	(*) In fact, all errors from iostat (dkstats.c|tpstats.c) are
	useless in this area and should be sought for explicitly if
	desired, not accidentally.

>How-To-Repeat:
	.
>Fix:
	
--- etc/security.org	2005-04-12 11:54:20.000000000 +1000
+++ etc/security	2005-08-26 12:37:17.000000000 +1000
@@ -808,14 +808,14 @@
 	xargs rm < $LABELS
 
 		# generate disklabels of all disks excluding:	cd fd md
-	disks=`iostat -x | awk 'NR > 1 && $1 !~ /^[cfm]d/ { print $1; }'`
+	disks=`iostat -x  2>/dev/null| awk 'NR > 1 && $1 !~ /^[cfm]d/ { print $1; }'`
 	for i in $disks; do
 		disklabel $i > "$work_dir/disklabel.$i" 2>/dev/null
 	done
 
 		# if fdisk is available, generate fdisks for:	ed ld sd wd
 	if [ -x /sbin/fdisk ]; then
-		disks=`iostat -x| awk 'NR > 1 && $1 ~ /^[elsw]d/ { print $1; }'`
+		disks=`iostat -x 2>/dev/null| awk 'NR > 1 && $1 ~ /^[elsw]d/ { print $1; }'`
 		for i in $disks; do
 			/sbin/fdisk $i > "$work_dir/fdisk.$i" 2>/dev/null
 		done