From owner-freebsd-questions@FreeBSD.ORG Fri Jan 14 03:03:12 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 64497106564A for ; Fri, 14 Jan 2011 03:03:12 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 236C78FC0C for ; Fri, 14 Jan 2011 03:03:11 +0000 (UTC) Received: from r55.edvax.de (port-92-195-143-131.dynamic.qsc.de [92.195.143.131]) by mx01.qsc.de (Postfix) with ESMTP id 3CAE03DE98; Fri, 14 Jan 2011 04:03:10 +0100 (CET) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id p0E3396O003361; Fri, 14 Jan 2011 04:03:09 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Fri, 14 Jan 2011 04:03:08 +0100 From: Polytropon To: Adam Vande More Message-Id: <20110114040308.056850ce.freebsd@edvax.de> In-Reply-To: References: <201101140159.p0E1xqUi029905@mail.r-bonomi.com> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: questions@freebsd.org, Robert Bonomi Subject: Re: Simple command to reset / clear all logs? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jan 2011 03:03:12 -0000 On Thu, 13 Jan 2011 20:11:03 -0600, Adam Vande More wrote: > Amusing, but you're the one full of shit. There's more things to automatic > log file creation than are thought of in your imagination. Adam, I think Robert is right at least in regards of SOME programs that use syslogd for logging OR do the logging stuff on their own. I may mantion ftpd logging as an example. Many years ago, I have learned that setting ftp (...stuff...) ftpd -ll in /etc/inetd.conf (the "ell ell" is important) and adding !ftpd *.* /var/log/ftpd.log to /etc/syslog.conf would cause ftpd to do extended logging. You can imagine how surprised I was that there was no log file at all. I had to manually # touch /var/log/ftpd.log in order to enable the logging mechanism. Simply deleting the file won't cause ftpd to create it on its own, and syslod also doesn't create it, if I remember correctly. It's also worth mentioning that programs that handle logging on their own may be brought into trouble if the logfile suddenly disappears, depending on the access mechanism for that file, either by "open/append, write, close" or by "don't close, keep writing". That being said, I think one can recommend resetting or clearing methods for all logs not depending on deleting and (maybe) re-creating the files. Instead setting them to zero length should not harm syslogd or any other process that logs to files. The methods of "echo '' > $file" or even the more verbose "cat /dev/zero > $file" have been mentioned on list, with $file being a shell wildcard expression or `find ...` for better control about what to work with. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...