From owner-freebsd-rc@FreeBSD.ORG Mon Oct 9 18:55:53 2006 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 510F416A4E5 for ; Mon, 9 Oct 2006 18:55:53 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx24.fluidhosting.com [204.14.89.7]) by mx1.FreeBSD.org (Postfix) with SMTP id 02E5143E8C for ; Mon, 9 Oct 2006 18:54:43 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: (qmail 32307 invoked by uid 399); 9 Oct 2006 18:54:30 -0000 Received: from localhost (HELO ?156.154.4.170?) (dougb@dougbarton.us@127.0.0.1) by localhost with SMTP; 9 Oct 2006 18:54:30 -0000 Message-ID: <452A9AE0.8090606@FreeBSD.org> Date: Mon, 09 Oct 2006 11:54:24 -0700 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: Yar Tikhiy References: <20061009120756.GA2805@comp.chem.msu.su> In-Reply-To: <20061009120756.GA2805@comp.chem.msu.su> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Andrey Simonenko , freebsd-rc@freebsd.org Subject: Re: bin/104044: [patch] rc.d/cleartmp works incorrectly X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Oct 2006 18:55:53 -0000 Guys, I don't object if you (pl.) decide to tune this up, but please be aware that it took Brooks and I quite a bit of time to work out The Right Thing To Do for all the various combinations. Please don't forget to include both memory backed tmp and permanent disk based tmp in your testing. I'll try to chime in if I can find the time, but right now I'm working in other areas. One final request, please do not MFC this change before 6.2-RELEASE unless it has had _at least_ a couple of weeks to mature first. I feel strongly at this point that rushing this in right before the release would have more potential to do harm than good. Thanks, Doug Yar Tikhiy wrote: > On Mon, Oct 09, 2006 at 11:52:30AM +0100, Florent Thoumie wrote: >> On Mon, 2006-10-09 at 09:10 +0000, Andrey Simonenko wrote: >>> The following reply was made to PR bin/104044; it has been noted by GNATS. >>> >>> From: Andrey Simonenko >>> To: bug-followup@FreeBSD.org >>> Cc: >>> Subject: Re: bin/104044: [patch] rc.d/cleartmp works incorrectly >>> Date: Mon, 9 Oct 2006 12:07:16 +0300 >>> >>> Updated version of cleartmp: >>> >>> 1. Change "rm -rf ..." to "rm -rf -- ..." >>> >>> 2. Remove cleartmp_X() and createtmp_X() functions. >> Haven't tested it yet but the patch looks good to me. Anybody else to >> have a look? > > The patch looks _almost_ good to me. For the sake of style, I'd > rather move the clear_tmp_X block to inside the start method. That > would require renaming rcvar to, say, rcvar1 and checking it from > the script. E.g.: > > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > ... > rcvar1=`set_rcvar clear_tmp` > ... > cleartmp_start() > { > if checkyesno ${rcvar1}; then > echo "Clearing /tmp." > ... > elif checkyesno clear_tmp_X; then > echo "Clearing /tmp (X related)." > rm -rf /tmp/.X[0-9]-lock ${x11_socket_dirs} > fi > if checkyesno clear_tmp_X; then > # Recreate X related directories. > mkdir -m 1777 ${x11_socket_dirs} > fi > } > > run_rc_command "$1" > %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% > > My point is that well-behaved rc.d scripts don't do their job outside > of their methods. > -- This .signature sanitized for your protection