From owner-freebsd-bugs@FreeBSD.ORG Sun Sep 9 21:00:09 2007 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 264BD16A41B for ; Sun, 9 Sep 2007 21:00:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E5A6A13C4F4 for ; Sun, 9 Sep 2007 21:00:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id l89L08eB065159 for ; Sun, 9 Sep 2007 21:00:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id l89L08bZ065158; Sun, 9 Sep 2007 21:00:08 GMT (envelope-from gnats) Resent-Date: Sun, 9 Sep 2007 21:00:08 GMT Resent-Message-Id: <200709092100.l89L08bZ065158@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Olli Hauer Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B67A516A417 for ; Sun, 9 Sep 2007 20:54:13 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 83F5E13C442 for ; Sun, 9 Sep 2007 20:54:13 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.1/8.14.1) with ESMTP id l89KsD09008052 for ; Sun, 9 Sep 2007 20:54:13 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.1/8.14.1/Submit) id l89KsDNd008051; Sun, 9 Sep 2007 20:54:13 GMT (envelope-from nobody) Message-Id: <200709092054.l89KsDNd008051@www.freebsd.org> Date: Sun, 9 Sep 2007 20:54:13 GMT From: Olli Hauer To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: conf/116237: [path] ugly output of the 405.status-ata-raid if fdescfs is mounted X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Sep 2007 21:00:09 -0000 >Number: 116237 >Category: conf >Synopsis: [path] ugly output of the 405.status-ata-raid if fdescfs is mounted >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Sep 09 21:00:08 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Olli Hauer >Release: FreeBSD 6.2-RELEASE-p7 >Organization: >Environment: FreeBSD 6.2-RELEASE-p7 >Description: If you use the 405.status-ata-raid option to monitor the status of your ar raids for example promise ... the outout of the daily mail is nearly unusable if fdescfs is mounted. fdescfs is needed for example for the port mail/spamd The output in the mail looks like this: find: /dev/fd/3/.k5login: No such file or directory find: /dev/fd/3/.cshrc: No such file or directory find: /dev/fd/3/.login: No such file or directory find: /dev/fd/3/.profile: No such file or directory find: /dev/fd/3/.bash_profile: No such file or directory find: /dev/fd/3/.bash_history: No such file or directory find: /dev/fd/3/cvsup: No such file or directory find: /dev/fd/3/bin: No such file or directory find: /dev/fd/3/.ssh: No such file or directory find: /dev/fd/3/.xinitrc: No such file or directory find: /dev/fd/3/update_ports.sh: No such file or directory find: /dev/fd/3/ret_1.sh: No such file or directory find: /dev/fd/3/.cvsrc: No such file or directory find: /dev/fd/3/.vnc: No such file or directory find: /dev/fd/3/X0-config.keyboard: No such file or directory find: /dev/fd/3/xorg.conf.new: No such file or directory find: /dev/fd/3/.Xauthority: No such file or directory find: /dev/fd/3/.fluxbox_old: No such file or directory >How-To-Repeat: To have an expirience how the daily staus mail looks do the following. mount -t fdescfs fdescfs /dev/fd cd / find /dev -name 'ar[0-9]' >Fix: see attached patches for: - etc/default/periodic.conf - src/share/man/man5/periodic.conf.5 - etc/periodic/daily/405.,status-ata-raid Now You have a extra parameter - dayly_status_ata_raid_list="" for example - ar0 => "0" - ar0 and ar1 => "0 1" the output is now clear and displays the right thing. Patch attached with submission follows: --- src/etc/periodic/daily/405.status-ata-raid.orig +++ src/etc/periodic/daily/405.status-ata-raid @@ -16,15 +16,29 @@ echo echo 'Checking status of ATA raid partitions:' + eval arlist=\$daily_status_ata_raid_list + rc=0 - 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 + + if [ "X$arlist" != "X" ]; + then + for raid in $arlist; + do + status=`/sbin/atacontrol status ar$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;; --- src/etc/defaults/periodic.conf.orig +++ src/etc/defaults/periodic.conf @@ -90,6 +90,9 @@ # 405.status-ata_raid daily_status_ata_raid_enable="NO" # Check ATA raid status +daily_status_ata_raid_list="" # List of ataraids, if empty raids are searched + # Example for ar0 and ar1 + # sample: daily_status_ata_raid_list="0 1" # 406.status-gmirror daily_status_gmirror_enable="NO" # Check gmirror(8) --- src/share/man/man5/periodic.conf.5.orig +++ src/share/man/man5/periodic.conf.5 @@ -359,6 +359,15 @@ on your .Xr ataraid 4 arrays. +.It Va daily_status_ata_raid_list +.Pq Vt num +Set to +.Dq "0 1" +if you want to run +.Nm atacontrol status +on your +.Xr ataraid 4 +ar0 and ar1 arrays. If empty the arrays are searched. .It Va daily_status_gmirror_enable .Pq Vt bool Set to >Release-Note: >Audit-Trail: >Unformatted: