From owner-cvs-src@FreeBSD.ORG Tue Oct 17 21:05:38 2006 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1115B16A40F; Tue, 17 Oct 2006 21:05:38 +0000 (UTC) (envelope-from ceri@submonkey.net) Received: from shrike.submonkey.net (cpc2-cdif2-0-0-cust107.cdif.cable.ntl.com [81.104.168.108]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7047343D62; Tue, 17 Oct 2006 21:05:36 +0000 (GMT) (envelope-from ceri@submonkey.net) Received: from ceri by shrike.submonkey.net with local (Exim 4.63 (FreeBSD)) (envelope-from ) id 1GZw7s-00086F-2R; Tue, 17 Oct 2006 22:05:28 +0100 Date: Tue, 17 Oct 2006 22:05:28 +0100 From: Ceri Davies To: Yar Tikhiy Message-ID: <20061017210527.GD92966@submonkey.net> Mail-Followup-To: Ceri Davies , Yar Tikhiy , src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org, Maxime Henrion , Andrzej Tobola References: <200610161301.k9GD1j0C074012@repoman.freebsd.org> <20061017173133.GD70184@comp.chem.msu.su> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ibTvN161/egqYuK8" Content-Disposition: inline In-Reply-To: <20061017173133.GD70184@comp.chem.msu.su> X-PGP: finger ceri@FreeBSD.org User-Agent: Mutt/1.5.13 (2006-08-11) Sender: Ceri Davies Cc: Maxime Henrion , cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org, Andrzej Tobola Subject: Re: cvs commit: src/etc/rc.d cleartmp X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Oct 2006 21:05:38 -0000 --ibTvN161/egqYuK8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Oct 17, 2006 at 09:31:33PM +0400, Yar Tikhiy wrote: > On Mon, Oct 16, 2006 at 01:01:45PM +0000, Yar Tikhiy wrote: > > yar 2006-10-16 13:01:45 UTC > >=20 > > FreeBSD src repository > >=20 > > Modified files: > > etc/rc.d cleartmp=20 > > Log: > > Improve cleartmp in a number of aspects: > > =20 > > + Use rc.subr(8) features properly. > > + Do the whole job of obliterating /tmp contents in find(1). > > + Leave lost+found and quota.{user,group} in /tmp only if root-owned. > > + Make the overall structure clearer by first removing the X dirs > > (perhaps along with the rest of /tmp) and then re-creating them. > > + Use "find -exec rm -rf {} +" for efficiency: each rm instance gets > > a chance to kill as much files in /tmp as ARG_MAX permits. >=20 > I was asked a few times why "-prune -exec rm -rf" had been chosen > over "-delete". My initial reason was that -delete would keep > bogus lost+found and quota.{user,group} entries found in subdirs > of /tmp. Well, on second thought, the find command line can be > tweaked so that -delete works as wanted. E.g.: >=20 > cd /tmp && find -x . ! -name . \ > ! \( -path ./lost+found -type d -user root \) \ > ! \( \( -path ./quota.user -or -path ./quota.group \)= \ > -type f -user root \) \ > -delete >=20 > Note using -path in place of -name. >=20 > However, it has recently been found that our fts(3) implementation > is unable to handle very deep trees -- see PR bin/104458. While > the bug hits both rm and find, rm has a better chance to recover > from it and gain the ability to remove virtually unlimited trees > while find is doomed to retain much more inherent limitations due > to its complex nature. Therefore I'm inclined to keep "-prune > -exec rm -rf" as a more robust approach, at least potentially. > So find has only to skim over /tmp while descending to its deeps > is left to rm. Given that we're deleting everything anyway, wouldn't it be possible to remove quota.{group,user} regardless and let quotacheck recreate them if required? This shouldn't take too long since there won't be much there. Also, if X requires certain directories, wouldn't it be better to blow them away here and have them created from a boot time script? Otherwise I don't understand how they ever get created. I'm aware that these are probably stupid questions with obvious answers but I think they're still worth asking. Ceri --=20 That must be wonderful! I don't understand it at all. -- Moliere --ibTvN161/egqYuK8 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFNUWXocfcwTS3JF8RAvpgAKCVynXKqsygoLNPL91OckBNfaMDbACgp9JZ nEzQakAlCTuqzICJ8FWlPQk= =H3Mo -----END PGP SIGNATURE----- --ibTvN161/egqYuK8--