Date: Sat, 23 Feb 2008 05:38:07 -0800 (PST) From: Jeremy Chadwick <koitsu@FreeBSD.org> To: FreeBSD-gnats-submit@FreeBSD.org Subject: conf/120993: 340.noid -- Add "find -x" capability (don't cross fs boundaries) Message-ID: <20080223133807.ADAD41CC033@mx01.sc1.parodius.com> Resent-Message-ID: <200802231340.m1NDe1If099271@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 120993 >Category: conf >Synopsis: 340.noid -- Add "find -x" capability (don't cross fs boundaries) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Sat Feb 23 13:40:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Jeremy Chadwick >Release: FreeBSD 6.3-PRERELEASE i386 >Organization: >Environment: System: FreeBSD eos.sc1.parodius.com 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #0: Mon Jan 14 17:48:12 PST 2008 root@eos.sc1.parodius.com:/usr/obj/usr/src/sys/EOS i386 >Description: Our backup server running FreeBSD rsync to do backups for all other machines on our network, storing the results in /storage (which is its own filesystem). All of our systems have different /etc/passwd and /etc/group files -- they are not identical across all machines. When weekly_noid_enable="yes" is used in periodic.conf on said server, find(1) will traverse / (see $weekly_noid_dirs), and **will** cross fs boundaries. This results in a 35MByte mail from "periodic weekly", which isn't desirable. >How-To-Repeat: See description. :-) >Fix: Add support for the -x argument to find(1) in 340.noid. Below is the patch, and has been tested on both RELENG_7 and RELENG_6 with success. With this patch, we can then do use the following in periodic.conf, thus stopping find(1) from ever hitting /storage: weekly_noid_enable="yes" weekly_noid_crossfs="no" weekly_noid_dirs="/ /var /tmp /usr" periodic.conf(5) will also need to be updated to reflect this addition. --- 340.noid.orig 2008-02-23 05:33:55.000000000 -0800 +++ 340.noid 2008-02-23 05:34:44.000000000 -0800 @@ -11,12 +11,19 @@ source_periodic_confs fi +crossfs="" +case "$weekly_noid_crossfs" in + [Nn][Oo]) + crossfs="-x" + ;; +esac + case "$weekly_noid_enable" in [Yy][Ee][Ss]) echo "" echo "Check for files with an unknown user or group:" - rc=$(find -H ${weekly_noid_dirs:-/} \ + rc=$(find -H ${crossfs} ${weekly_noid_dirs:-/} \ \( ! -fstype local -prune -or -name \* \) -and \ \( -nogroup -o -nouser \) -print | sed 's/^/ /' | tee /dev/stderr | wc -l) >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080223133807.ADAD41CC033>