Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Sep 2007 20:54:13 GMT
From:      Olli Hauer <ohauer@gmx.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   conf/116237: [path] ugly output of the 405.status-ata-raid if fdescfs is mounted
Message-ID:  <200709092054.l89KsDNd008051@www.freebsd.org>
Resent-Message-ID: <200709092100.l89L08bZ065158@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200709092054.l89KsDNd008051>