From owner-freebsd-questions@FreeBSD.ORG Thu Jan 13 20:50:41 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5944B106566B for ; Thu, 13 Jan 2011 20:50:41 +0000 (UTC) (envelope-from bonomi@mail.r-bonomi.com) Received: from mail.r-bonomi.com (host-120.r-bonomi.com [204.87.227.120]) by mx1.freebsd.org (Postfix) with ESMTP id 1296C8FC08 for ; Thu, 13 Jan 2011 20:50:40 +0000 (UTC) Received: (from bonomi@localhost) by mail.r-bonomi.com (8.14.4/rdb1) id p0DKu3tq027950 for freebsd-questions@freebsd.org; Thu, 13 Jan 2011 14:56:03 -0600 (CST) Date: Thu, 13 Jan 2011 14:56:03 -0600 (CST) From: Robert Bonomi Message-Id: <201101132056.p0DKu3tq027950@mail.r-bonomi.com> To: freebsd-questions@freebsd.org In-Reply-To: <20110112205804.3ec42ec8.freebsd@edvax.de> Subject: Re: Simple command to reset / clear all logs? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Jan 2011 20:50:41 -0000 > Date: Wed, 12 Jan 2011 20:58:04 +0100 > From: Polytropon > Subject: Re: Simple command to reset / clear all logs? > > On Wed, 12 Jan 2011 20:50:04 +0100, Redd Vinylene > 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.