From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 28 18:25:51 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D379B106564A; Fri, 28 Jan 2011 18:25:51 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C27958FC15; Fri, 28 Jan 2011 18:25:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SIPpw8093836; Fri, 28 Jan 2011 18:25:51 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SIPpaQ093834; Fri, 28 Jan 2011 18:25:51 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201101281825.p0SIPpaQ093834@svn.freebsd.org> From: Josh Paetzel Date: Fri, 28 Jan 2011 18:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218027 - stable/8/etc/periodic/daily X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 18:25:51 -0000 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