svn commit: r218027 - stable/8/etc/periodic/daily
Josh Paetzel
jpaetzel at FreeBSD.org
Fri Jan 28 18:25:51 UTC 2011
Author: jpaetzel
Date: Fri Jan 28 18:25:51 2011
New Revision: 218027
URL: http://svn.freebsd.org/changeset/base/218027
Log:
MFC: r217755 r217822
This script parses output of userland tools. In the case of a faulted
zpool the output causes the script to bail out with syntax errors.
Since a scrub of a faulted zpool is pointless, just skip over any
pools marked as such.
PR: conf/150228
Approved by: kib (mentor)
Modified:
stable/8/etc/periodic/daily/800.scrub-zfs
Directory Properties:
stable/8/etc/ (props changed)
Modified: stable/8/etc/periodic/daily/800.scrub-zfs
==============================================================================
--- stable/8/etc/periodic/daily/800.scrub-zfs Fri Jan 28 17:37:09 2011 (r218026)
+++ stable/8/etc/periodic/daily/800.scrub-zfs Fri Jan 28 18:25:51 2011 (r218027)
@@ -5,6 +5,10 @@
# If there is a global system configuration file, suck it in.
#
+
+newline="
+" # A single newline
+
if [ -r /etc/defaults/periodic.conf ]
then
. /etc/defaults/periodic.conf
@@ -24,13 +28,19 @@ case "$daily_scrub_zfs_enable" in
for pool in ${daily_scrub_zfs_pools}; do
# sanity check
- zpool list ${pool} >/dev/null 2>&1
+ _status=$(zpool list "${pool}" 2> /dev/null)
if [ $? -ne 0 ]; then
echo " WARNING: pool '${pool}' specified in"
echo " '/etc/periodic.conf:daily_scrub_zfs_pools'"
echo " does not exist"
continue
fi
+ _status=${_status##*$newline}
+ case ${_status} in
+ *FAULTED*)
+ echo "Skipping faulted pool: ${pool}"
+ continue ;;
+ esac
# successful only if there is at least one pool to scrub
rc=0
More information about the svn-src-stable
mailing list