Date: Fri, 14 Jan 2011 04:03:08 +0100 From: Polytropon <freebsd@edvax.de> To: Adam Vande More <amvandemore@gmail.com> Cc: questions@freebsd.org, Robert Bonomi <bonomi@mail.r-bonomi.com> Subject: Re: Simple command to reset / clear all logs? Message-ID: <20110114040308.056850ce.freebsd@edvax.de> In-Reply-To: <AANLkTi=MFSvXZ29KmeBbKvg7_cEZc3wuE737Fq69efKe@mail.gmail.com> References: <AANLkTi=49Zopo0xCO=nOrf05DqNSV1k0P%2B%2Bf-G0XPZcA@mail.gmail.com> <201101140159.p0E1xqUi029905@mail.r-bonomi.com> <AANLkTi=MFSvXZ29KmeBbKvg7_cEZc3wuE737Fq69efKe@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 13 Jan 2011 20:11:03 -0600, Adam Vande More <amvandemore@gmail.com> 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, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110114040308.056850ce.freebsd>