Date: Thu, 13 Jan 2011 14:54:46 -0600 From: Tim Daneliuk <tundra@tundraware.com> To: FreeBSD Mailing List <freebsd-questions@freebsd.org> Subject: Re: Simple command to reset / clear all logs? Message-ID: <4D2F6696.6030403@tundraware.com> In-Reply-To: <201101132056.p0DKu3tq027950@mail.r-bonomi.com> References: <201101132056.p0DKu3tq027950@mail.r-bonomi.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 1/13/2011 2:56 PM, Robert Bonomi wrote: >> Date: Wed, 12 Jan 2011 20:58:04 +0100 >> From: Polytropon <freebsd@edvax.de> >> Subject: Re: Simple command to reset / clear all logs? >> >> On Wed, 12 Jan 2011 20:50:04 +0100, Redd Vinylene >> <reddvinylene@gmail.com> wrote: >>> Will the logs automatically create themselves? >> >> Usually not, but it depends on the logging mechanism. If a program >> continuously re-opens the file (after closing it) in APPEND mode, it >> should be created if non-existent. But if the program keeps the file open >> and just writes to it, it can cause trouble. Good programs check the >> return code of the writing operation and signal an error. Bad programs >> don't do that, they just keep writing to nowhere. :-) > > _syslogd_ *explicitly* does -not- _create_ any log files. it is documented > in the manpages that it behaves that way. Whether or not this is a "good > idea" is debatable, but it does allow you to suppress some logging w/o having > to edit the syslog.conf file and/or re-start syslogd. > >>> I mean, I picture I have to manually touch a lotta them in order to >>> avoid "cannot find" error messages? > > Syslog does -not- give any such messages, it just doesn't write the message > anywere. It's worth noting that if you delete an open file, any programs with open write handles to the file can still write to it and thus chew up disk space. So ... you can't just reach in and delete log files unless you're sure nothing has them open. -- ------------------------------------------------------------------------ Tim Daneliuk tundra@tundraware.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D2F6696.6030403>