From owner-freebsd-hackers@FreeBSD.ORG Tue Feb 22 15:57:15 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8628106566B for ; Tue, 22 Feb 2011 15:57:15 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5B1308FC15 for ; Tue, 22 Feb 2011 15:57:15 +0000 (UTC) Received: by wyb32 with SMTP id 32so3099396wyb.13 for ; Tue, 22 Feb 2011 07:57:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=b6UYwQKvkAkD/dLj7CD1EEe2xSY6uhELQfEnhaOQgF4=; b=nseNgShalA730rXTETi1fAqgug2/sR2q23WqRCGkozL7al43YnfD5W10A32R5Gv749 7sCXQ1iQqj9UfyPw2pQ95xSBeXL2FoSECy8tYU9bebFrUf8b53tyS/BEG98SWP2BFAkE h2ji3hPlRVDy66ZrAh5S/oVBhrbTM6cs9TQd0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=Y0sMofOLlLnnZiXdYB+xV6zxSIU6E1LmwHAvVnCxrtQ8+YfqKquS5v7M+WoBxOVejA TM43dGX5bOUpQPP7kyhMtVjXxdJc+N60s5RVMd8quW/mqI0iABgxwVJa2soDCG3Tou2i Z9YbUccLPjeVNvPa5ICfojKjxwtqd84reDfkQ= MIME-Version: 1.0 Received: by 10.216.46.193 with SMTP id r43mr3471081web.20.1298390234437; Tue, 22 Feb 2011 07:57:14 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.15.74 with HTTP; Tue, 22 Feb 2011 07:57:14 -0800 (PST) In-Reply-To: <4D63659E.6010305@dougbarton.us> References: <4D6323D9.5090500@dougbarton.us> <4D63659E.6010305@dougbarton.us> Date: Tue, 22 Feb 2011 07:57:14 -0800 X-Google-Sender-Auth: olAFOCiD_G_K05iB9IdGIsh8SmA Message-ID: From: Garrett Cooper To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org Subject: Re: Problem with etc/periodic/daily/310.accounting X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Feb 2011 15:57:15 -0000 On Mon, Feb 21, 2011 at 11:28 PM, Doug Barton wrote: > Ignore my last. > > The problem is that if /var/account/acct disappears then accounting stops= . > The attached is better, albeit more complicated. It also has the pleasant > side effect of cleaning up /etc/rc.d/accounting a bit. > > I've confirmed that with this patch nothing is lost while the file is bei= ng > switched: > > unlink =A0 - =A0 =A0root =A0 =A0 =A0 pts/2 =A0 0.006 secs Mon Feb 21 23:2= 3 > sa =A0 =A0 =A0 - =A0 =A0root =A0 =A0 =A0 pts/2 =A0 0.014 secs Mon Feb 21 = 23:23 > gzip =A0 =A0 - =A0 =A0root =A0 =A0 =A0 pts/2 =A0 0.014 secs Mon Feb 21 23= :23 > sh =A0 =A0 =A0 - =A0 =A0root =A0 =A0 =A0 pts/2 =A0 0.099 secs Mon Feb 21 = 23:23 > unlink =A0 - =A0 =A0root =A0 =A0 =A0 pts/2 =A0 0.006 secs Mon Feb 21 23:2= 3 > accton =A0 - =A0 =A0root =A0 =A0 =A0 pts/2 =A0 0.006 secs Mon Feb 21 23:2= 3 > ln =A0 =A0 =A0 - =A0 =A0root =A0 =A0 =A0 pts/2 =A0 0.006 secs Mon Feb 21 = 23:23 > mv =A0 =A0 =A0 - =A0 =A0root =A0 =A0 =A0 pts/2 =A0 0.007 secs Mon Feb 21 = 23:23 > accton =A0 - =A0 =A0root =A0 =A0 =A0 pts/2 =A0 0.011 secs Mon Feb 21 23:2= 3 Can accounting_file by provided by user input (doesn't look like it today, but just to be safe I thought I should check)? If so then the dirname should be restored. Example: $ foo=3D/a/b//////c $ echo ${foo%/*} /a/b///// $ dirname $foo /a/b Thanks, -Garrett