From owner-freebsd-bugs@FreeBSD.ORG Wed Mar 25 19:10:02 2009 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 7C4C01065673 for ; Wed, 25 Mar 2009 19:10:02 +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 565528FC14 for ; Wed, 25 Mar 2009 19:10:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PJA1R3060077 for ; Wed, 25 Mar 2009 19:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n2PJA1Hj060076; Wed, 25 Mar 2009 19:10:01 GMT (envelope-from gnats) Resent-Date: Wed, 25 Mar 2009 19:10:01 GMT Resent-Message-Id: <200903251910.n2PJA1Hj060076@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, Kael Fischer Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82A4C1065677 for ; Wed, 25 Mar 2009 19:04:58 +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 703278FC25 for ; Wed, 25 Mar 2009 19:04:58 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n2PJ4wex047396 for ; Wed, 25 Mar 2009 19:04:58 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n2PJ4wJ4047395; Wed, 25 Mar 2009 19:04:58 GMT (envelope-from nobody) Message-Id: <200903251904.n2PJ4wJ4047395@www.freebsd.org> Date: Wed, 25 Mar 2009 19:04:58 GMT From: Kael Fischer To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/133070: /etc/periodic/daily/100.clean-disks traverses non-local file systems 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: Wed, 25 Mar 2009 19:10:03 -0000 >Number: 133070 >Category: misc >Synopsis: /etc/periodic/daily/100.clean-disks traverses non-local file systems >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Mar 25 19:10:00 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Kael Fischer >Release: 7.0-RELEASE-p5 >Organization: University of Utah >Environment: 7.0-RELEASE-p5 FreeBSD 7.0-RELEASE-p5 #0: Wed Oct 1 07:51:58 UTC 2008 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 >Description: Reading the script /etc/periodic/daily/100.clean-disks it seems that the authors intend to not traverse non-local file systems. However, the find command used DOES traverse non-local file systems. This can lead to lots of "permission denied" on all the machines of a cluster and clutter the periodic output badly. As has been noted on the mailing lists 'find -x ' is probably the way to go. >How-To-Repeat: set (in /etc/periodic.conf): daily_clean_disks_enable="YES" daily_clean_disks_files="[#,]* .#* a.out *.core *.CKP .emacs_[0-9]*" daily_clean_disks_days=3 daily_clean_disks_verbose="YES" On a system that has an nfs mount, where the server has -maproot=nobody in /etc/exports >Fix: Apply patch. Patch extracts local mount points from mount -p output as follows: all lines are considered local and cleanable that begin with / and are mounted 'rw'. These are presented to find after -x, i.e. 'find -x / /tmp/ usr /var ...) rather than the current 'find / ...' Patch attached with submission follows: --- 100.clean-disks.orig 2008-02-24 02:41:26.000000000 -0700 +++ 100.clean-disks 2009-03-25 12:19:37.000000000 -0600 @@ -41,7 +41,8 @@ print=;; esac - rc=$(find / \( ! -fstype local -o -fstype rdonly \) -a -prune -o \ + rc=$(find -x $(mount -p | awk '/^\// {if($4=="rw") print $2;}') \ + \( ! -fstype local -o -fstype rdonly \) -a -prune -o \ \( $args \) -atime +$daily_clean_disks_days -delete $print | tee /dev/stderr | wc -l) [ -z "$print" ] && rc=0 >Release-Note: >Audit-Trail: >Unformatted: