From owner-freebsd-questions@FreeBSD.ORG Fri Jan 14 01:54:27 2011 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80038106564A for ; Fri, 14 Jan 2011 01:54:27 +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 3AC888FC12 for ; Fri, 14 Jan 2011 01:54:26 +0000 (UTC) Received: (from bonomi@localhost) by mail.r-bonomi.com (8.14.4/rdb1) id p0E1xqUi029905 for questions@freebsd.org; Thu, 13 Jan 2011 19:59:52 -0600 (CST) Date: Thu, 13 Jan 2011 19:59:52 -0600 (CST) From: Robert Bonomi Message-Id: <201101140159.p0E1xqUi029905@mail.r-bonomi.com> To: questions@freebsd.org In-Reply-To: Cc: 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: Fri, 14 Jan 2011 01:54:27 -0000 > Date: Thu, 13 Jan 2011 18:31:21 -0600 > Subject: Re: Simple command to reset / clear all logs? > To: questions@freebsd.org > > On Thu, Jan 13, 2011 at 6:28 PM, Robert Bonomi > wrote: > > > > From: Adam Vande More > > > > > > Please don't top post. > > > > > > do something like this: > > > > > > shutdown now rm /var/log/* exit > > > > > > upon reentering multiuser mode, each logging service will create it's > > > new file. > > > > FALSE TO FACT, with regard to any/all files that syslogd(8) uses, > > _unless_ syslogd is invoked with the '-C' option. > > > > Quoting from the manpage: > > "For security reasons, syslogd will not append to log files that do > > not exist (unless -C option is specified); therefore, they must be > > created manually before running syslogd." > > > > Wrong, read what I said again. I *did* read what you said. To be blunt, you are full of sh*t as regards any file used by the standard Berkeley syslog daemon, (syslogd). The Berkeley syslogd is the standard system log daemon on FreeBSD, although somme people do replace it with > The appropriate service recreates the log > file. _IF_ a service, e.g, apache logs _directly_ to it's own logfiles, this _may_ be true It is explicitly *NOT*TRUE* for log files used by the standard (Berkeley-based) syslogd daemon. The FreeBSD manpage for syslogd, quoted above, confirms that you do -not- know what you're talking about. > Any basic system log would be covered by this. "Male Bovine Excretement" applies. > Try it and see. I've got over 25 years experience as a professional system/network admin, all on BSD-derived systems. I can't tell you _how_many_ times I've been called in to fix a 'failure to log' problem that was due to the logfile simply -not- being present, even afer a reboot. Now I'm not infallable, so I cheked the reference documentation _before_ posting, The standard FreeBSD syslogd is -documented- as _NOT_CREATING_ the logfiles it uses, *UNLESS* the '-C' option is specified upon program invocation. Since a logging service cannot tell whether the system is in single-user or multi-user mode, you can verify this syslogd behaviour by simply deleting one of the common log files -- say /var/log/messages -- then killing the running syslogd, and re-starting it. As you say "Try it and see". -- Those of you who think you know it all are very annoying to those of us who do.