Date: Sun, 7 Jul 2002 10:40:44 +0200 From: Nicolas Rachinsky <list@rachinsky.de> To: freebsd-stable@FreeBSD.ORG Subject: Re: cvs commit: src/usr.sbin/newsyslog newsyslog.c Message-ID: <20020707084044.GA19140@narr.dauerreden.de> In-Reply-To: <3D27B7B2.1B8EEE9B@FreeBSD.org> References: <200207011244.g61CiG3Y013597@freefall.freebsd.org> <20020707022423.GA51424@gw.tex.bogus> <3D27B7B2.1B8EEE9B@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
* Doug Barton <DougB@FreeBSD.ORG> [2002-07-06 20:38 -0700]: > Nuno Teixeira wrote: > > > Does this mean that now I can use newsyslog to compress apache logs? > > The problem with newsyslog and things like apache and named is that the > process continues writing to the file after you mv it. The proper > procedure for such processes is: > > mv logfile logfile.old > hup process > (process creates and starts writing to new log) > compress logfile.old newsyslog in 4.6 RELEASE does: mv logfile logfile.old touch logfile hup daemon sleep(10) compress BTW I just mv'd some of my logfiles, syslogd is happily continuing to write to them. > That way you don't lose anything. Since it's designed to work with > syslogd, what newsyslog does is: > > mv logfile logfile.old > (syslogd stops writing to logfile) > compress logfile.old > create logfile > hup syslogd I don't think so. > That works fine for syslog, but wreaks havoc with things like apache and > named. There is a ${PREFIX}/sbin/rotatelogs script that comes with > apache, you should take a look at that and modify it to suit your needs. It wouldn't work for syslog. Nicolas To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020707084044.GA19140>