Skip site navigation (1)Skip section navigation (2)
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 being
> switched:
>
> unlink   -    root       pts/2   0.006 secs Mon Feb 21 23:23
> sa       -    root       pts/2   0.014 secs Mon Feb 21 23:23
> gzip     -    root       pts/2   0.014 secs Mon Feb 21 23:23
> sh       -    root       pts/2   0.099 secs Mon Feb 21 23:23
> unlink   -    root       pts/2   0.006 secs Mon Feb 21 23:23
> accton   -    root       pts/2   0.006 secs Mon Feb 21 23:23
> ln       -    root       pts/2   0.006 secs Mon Feb 21 23:23
> mv       -    root       pts/2   0.007 secs Mon Feb 21 23:23
> accton   -    root       pts/2   0.011 secs Mon Feb 21 23:23

    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=/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>