From nobody@FreeBSD.org  Mon Oct 24 14:25:17 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id BABA116A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 Oct 2005 14:25:17 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 6E0F743D45
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 Oct 2005 14:25:17 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j9OEPHqJ079849
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 24 Oct 2005 14:25:17 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j9OEPHos079848;
	Mon, 24 Oct 2005 14:25:17 GMT
	(envelope-from nobody)
Message-Id: <200510241425.j9OEPHos079848@www.freebsd.org>
Date: Mon, 24 Oct 2005 14:25:17 GMT
From: Olli Hauer <ohauer@gmx.de>
To: freebsd-gnats-submit@FreeBSD.org
Subject: periodic daily_status_ata_raid with mounted fdescfs
X-Send-Pr-Version: www-2.3

>Number:         87925
>Category:       conf
>Synopsis:       [patch] [request] modify output of 405.status_ata_raid with mounted fdescfs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 24 14:30:21 GMT 2005
>Closed-Date:    Thu Jul 22 13:00:39 EDT 2010
>Last-Modified:  Thu Jul 22 13:00:39 EDT 2010
>Originator:     Olli Hauer
>Release:        5.4-RELEASE-p8
>Organization:
>Environment:
5.4-RELEASE-p8 FreeBSD 5.4-RELEASE-p8 #0: Sat Oct 22 18:42:00 CEST 2005              
>Description:
strange output in daily status if fdescfs is mounted (for OpenBSD spamd)
and daily_status_ata_raid_enable="YES" in /etc/periodic.conf
              
>How-To-Repeat:
mount fdescfs
set daily_status_ata_raid_enable="YES" in /etc/periodic.conf
sh /etc/periodic/daily/405.status-ata-raid

it doesn't metter if some raid is installed or not watch the output
>Fix:
two solutions:

1. supress output from find in the daily/405 script (ugly)

--- 405.status-ata-raid.orig    Sun May  8 09:05:11 2005
+++ 405.status-ata-raid Mon Oct 24 15:32:13 2005
@@ -17,7 +17,7 @@
        echo 'Checking status of ATA raid partitions:'

        rc=0
-       for raid in `find /dev/ -name 'ar[0-9]*' -type c | egrep '[0-9]$' \
+       for raid in `find /dev/ -name 'ar[0-9]*' -type c 2> /dev/null | egrep '[0-9]$' \
                | egrep -v 's[0-9]' | cut -d / -f 3`
             do
                status=`/sbin/atacontrol status $raid`
              

2. extend periodic.conf and the daily/405 script

periodic.conf extra parameter
  daily_status_ata_raid_ar_list=""   # list of numbers, sample: 0 exapnds to ar0


change 405 script to something like this
(if the extra parameter daily_status_ata_raid_ar_list is not set, 
the script works like before)

#!/bin/sh
#
# $FreeBSD: src/etc/periodic/daily/405.status-ata-raid,v 1.1 2003/10/27 20:14:53 jesper Exp $
#

# If there is a global system configuration file, suck it in.
#
if [ -r /etc/defaults/periodic.conf ]
then
    . /etc/defaults/periodic.conf
    source_periodic_confs
fi


case "$daily_status_ata_raid_enable" in
    [Yy][Ee][Ss])
        echo
        echo 'Checking status of ATA raid partitions:'

        eval arlist=\$daily_status_ata_raid_ar_list

        rc=0

        if [ "X$arlist" != "X" ];
        then
            for raid in $arlist;
            do
                status=`/sbin/atacontrol status $raid`
                echo $status
                raid_rc=`echo $status | grep -v READY | wc -l`
                [ $rc -eq 0 ] && [ $raid_rc -gt 0 ] && rc=3
            done
        else
            for raid in `find /dev/ -name 'ar[0-9]*' -type c | egrep '[0-9]$' \
             | egrep -v 's[0-9]' | cut -d / -f 3`
                do
                    status=`/sbin/atacontrol status $raid`
                    echo $status
                    raid_rc=`echo $status | grep -v READY | wc -l`
                    [ $rc -eq 0 ] && [ $raid_rc -gt 0 ] && rc=3
            done
        fi
        ;;

    *)  rc=0;;
esac

exit $rc

              
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: glarkin 
State-Changed-When: Thu Jul 22 12:59:25 EDT 2010 
State-Changed-Why:  
Closed by request of submitter (via email) - ignored for too long 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87925 
>Unformatted:
