Date: Thu, 13 Jan 2011 19:59:52 -0600 (CST) From: Robert Bonomi <bonomi@mail.r-bonomi.com> To: questions@freebsd.org Subject: Re: Simple command to reset / clear all logs? Message-ID: <201101140159.p0E1xqUi029905@mail.r-bonomi.com> In-Reply-To: <AANLkTi=49Zopo0xCO=nOrf05DqNSV1k0P%2B%2Bf-G0XPZcA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> 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 > <bonomi@mail.r-bonomi.com>wrote: > > > > From: Adam Vande More <amvandemore@gmail.com> > > > > > > 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101140159.p0E1xqUi029905>