Date: Tue, 22 Feb 2011 07:57:14 -0800 From: Garrett Cooper <gcooper@FreeBSD.org> To: Doug Barton <dougb@dougbarton.us> Cc: freebsd-hackers@freebsd.org Subject: Re: Problem with etc/periodic/daily/310.accounting Message-ID: <AANLkTimMDD3-vZAT6irMsc3MR1cO3R6TH3PX0f=g8xEM@mail.gmail.com> In-Reply-To: <4D63659E.6010305@dougbarton.us> References: <4D6323D9.5090500@dougbarton.us> <4D63659E.6010305@dougbarton.us>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Feb 21, 2011 at 11:28 PM, Doug Barton <dougb@dougbarton.us> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTimMDD3-vZAT6irMsc3MR1cO3R6TH3PX0f=g8xEM>
