From nobody@FreeBSD.org  Mon Sep 21 23:16:50 2009
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 6910410656A8
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Sep 2009 23:16:50 +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 572668FC24
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Sep 2009 23:16:50 +0000 (UTC)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n8LNGnwe092746
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 21 Sep 2009 23:16:49 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.3/8.14.3/Submit) id n8LNGnjO092745;
	Mon, 21 Sep 2009 23:16:49 GMT
	(envelope-from nobody)
Message-Id: <200909212316.n8LNGnjO092745@www.freebsd.org>
Date: Mon, 21 Sep 2009 23:16:49 GMT
From: Ryan Davis <ryand-freebsd@zenspider.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: 100.clean-disks shouldn't traverse devfs mounts
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         139040
>Category:       conf
>Synopsis:       [patch] 100.clean-disks shouldn't traverse devfs mounts
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 21 23:20:01 UTC 2009
>Closed-Date:    Sat Mar 13 12:28:43 UTC 2010
>Last-Modified:  Sat Mar 13 12:28:43 UTC 2010
>Originator:     Ryan Davis
>Release:        7.1-RELEASE-p6
>Organization:
>Environment:
FreeBSD greed.zenspider.com 7.1-RELEASE-p6 FreeBSD 7.1-RELEASE-p6 #0: Tue Jun  9 16:26:47 UTC 2009     root@i386-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
The daily clean script is traversing into devfs space, which is getting pissy with my /dev/fd mount causing LOTS of spew in my daily emails.

PLEASE NOTE: This isn't about fdescfs being deprecated. That isn't the point at all (it is needed for obspamd). clean shouldn't go into /dev in the first place.

518 % cd /etc/periodic/daily/
519 % mount
/dev/ad0s1a on / (ufs, local)
devfs on /dev (devfs, local)
/dev/ad1s1a on /home (ufs, local)
devfs on /var/named/dev (devfs, local)
fdescfs on /dev/fd (fdescfs)
520 % sudo sh 100.clean-disks 
Password:

Cleaning disks:
find: /dev/fd/3/100.clean-disks: No such file or directory
find: /dev/fd/3/110.clean-tmps: No such file or directory
find: /dev/fd/3/120.clean-preserve: No such file or directory
find: /dev/fd/3/130.clean-msgs: No such file or directory
find: /dev/fd/3/140.clean-rwho: No such file or directory
find: /dev/fd/3/150.clean-hoststat: No such file or directory
find: /dev/fd/3/200.backup-passwd: No such file or directory
find: /dev/fd/3/210.backup-aliases: No such file or directory
find: /dev/fd/3/300.calendar: No such file or directory
find: /dev/fd/3/310.accounting: No such file or directory
find: /dev/fd/3/330.news: No such file or directory
find: /dev/fd/3/400.status-disks: No such file or directory
find: /dev/fd/3/404.status-zfs: No such file or directory
find: /dev/fd/3/405.status-ata-raid: No such file or directory
find: /dev/fd/3/406.status-gmirror: No such file or directory
find: /dev/fd/3/407.status-graid3: No such file or directory
find: /dev/fd/3/408.status-gstripe: No such file or directory
find: /dev/fd/3/409.status-gconcat: No such file or directory
find: /dev/fd/3/999.local: No such file or directory
find: /dev/fd/3/420.status-network: No such file or directory
find: /dev/fd/3/430.status-rwho: No such file or directory
find: /dev/fd/3/440.status-mailq: No such file or directory
find: /dev/fd/3/450.status-security: No such file or directory
find: /dev/fd/3/460.status-mail-rejects: No such file or directory
find: /dev/fd/3/470.status-named: No such file or directory
find: /dev/fd/3/480.status-ntpd: No such file or directory
find: /dev/fd/3/500.queuerun: No such file or directory
find: /dev/fd/3: No such file or directory
find: /dev/fd/4/100.clean-disks: No such file or directory
find: /dev/fd/4/110.clean-tmps: No such file or directory
find: /dev/fd/4/120.clean-preserve: No such file or directory
find: /dev/fd/4/130.clean-msgs: No such file or directory
find: /dev/fd/4/140.clean-rwho: No such file or directory
find: /dev/fd/4/150.clean-hoststat: No such file or directory
find: /dev/fd/4/200.backup-passwd: No such file or directory
find: /dev/fd/4/210.backup-aliases: No such file or directory
find: /dev/fd/4/300.calendar: No such file or directory
find: /dev/fd/4/310.accounting: No such file or directory
find: /dev/fd/4/330.news: No such file or directory
find: /dev/fd/4/400.status-disks: No such file or directory
find: /dev/fd/4/404.status-zfs: No such file or directory
find: /dev/fd/4/405.status-ata-raid: No such file or directory
find: /dev/fd/4/406.status-gmirror: No such file or directory
find: /dev/fd/4/407.status-graid3: No such file or directory
find: /dev/fd/4/408.status-gstripe: No such file or directory
find: /dev/fd/4/409.status-gconcat: No such file or directory
find: /dev/fd/4/999.local: No such file or directory
find: /dev/fd/4/420.status-network: No such file or directory
find: /dev/fd/4/430.status-rwho: No such file or directory
find: /dev/fd/4/440.status-mailq: No such file or directory
find: /dev/fd/4/450.status-security: No such file or directory
find: /dev/fd/4/460.status-mail-rejects: No such file or directory
find: /dev/fd/4/470.status-named: No such file or directory
find: /dev/fd/4/480.status-ntpd: No such file or directory
find: /dev/fd/4/500.queuerun: No such file or directory
find: /dev/fd/4: No such file or directory
find: /dev/fd/5: Bad file descriptor

>How-To-Repeat:
See console output above.
>Fix:
Untested:

            rc=$(find / \( ! -fstype local -o -fstype rdonly \) -a -prune -o \

should be something like:

            rc=$(find / \( ! -fstype local -o -fstype rdonly -o -fstype devfs \) -a -prune -o \


>Release-Note:
>Audit-Trail:

From: Jilles Tjoelker <jilles@stack.nl>
To: bug-followup@FreeBSD.org, ryand-freebsd@zenspider.com
Cc:  
Subject: Re: conf/139040: [patch] 100.clean-disks shouldn't traverse devfs
	mounts
Date: Sat, 10 Oct 2009 21:42:07 +0200

 Firstly, 8.x/9.x have all the /dev/fd nodes as character devices which
 will not be traversed.
 
 Secondly, your patch will not work. In fact, the entire
   \( ! -fstype local -o -fstype rdonly \) -a -prune
 part prunes nothing at all, since using -delete anywhere implies -d, and
 -prune does nothing if -d is in effect (this is because -d processes
 directories after their contents so -prune is too late). Because of the
 -o after it, it does, however, exclude all files on such filesystems.
 
 It would make more sense to create a list of mount points to traverse,
 then find through them all with -x, somewhat like
 etc/periodic/security/100.chksetuid does.
 
 -- 
 Jilles Tjoelker
State-Changed-From-To: open->closed  
State-Changed-By: brucec 
State-Changed-When: Sat Mar 13 12:28:11 UTC 2010 
State-Changed-Why:  
Duplicate of conf/84752. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=139040 
>Unformatted:
