From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2419 Path: news.gmane.org!.POSTED!not-for-mail From: Steve Litt Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: Log rotation issue with runit Date: Thu, 27 Dec 2018 08:47:16 -0500 Message-ID: <20181227084716.22c5f726@mydesk.domain.cxm> References: <20181226015822.GH29946@home.lan> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1545918312 19147 195.159.176.226 (27 Dec 2018 13:45:12 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 27 Dec 2018 13:45:12 +0000 (UTC) To: supervision@list.skarnet.org Original-X-From: supervision-return-2009-gcsg-supervision=m.gmane.org@list.skarnet.org Thu Dec 27 14:45:07 2018 Return-path: Envelope-to: gcsg-supervision@m.gmane.org Original-Received: from alyss.skarnet.org ([95.142.172.232]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1gcVyF-0004sB-H5 for gcsg-supervision@m.gmane.org; Thu, 27 Dec 2018 14:45:07 +0100 Original-Received: (qmail 10171 invoked by uid 89); 27 Dec 2018 13:47:44 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Original-Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 10164 invoked from network); 27 Dec 2018 13:47:44 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; h=X-Originating-IP:Date:From:To:Subject:Message-ID:In-Reply-To:References:X-Mailer:MIME-Version:Content-Type:Content-Transfer-Encoding; s=default; d=troubleshooters.com; b=RaCAwfl2VfmSewojCbWgTpPXasSQVCZYVVajJFZWi/6gRylVWEsKdzLK8eZcvXFEfbk8nhutbugsU0goRPWH2ek8ls2ISFRmeuhWBbyDuvJsxPso5fy6MANWjYqvvrSUM+221eR7nLSNuzL9Xli51o/4xmWLG+6Hp/Y1oPDccGQ=; DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/simple; d=troubleshooters.com; s=default; t=1545918436; bh=lE1ZfWn1QtMiWHjDmV/tzst+Q+c=; l=3564; h=X-Originating-IP:Date:From:To:Subject:Message-ID:In-Reply-To: References:X-Mailer:MIME-Version:Content-Type: Content-Transfer-Encoding; b=NEgDWAYfXBaUxSs/lSZq35jFvFrgu3FTj7fmw0AfbXIAHnEy0xFX1KRPjK9IcMdGN CyUeMk54K8mLp8/LZwLyJSPnxrtVX8r6zsbgo3WeA6BxQPIHrgBI7gnLH7A7aDIgzJ rsYEABA05sMy25FZqOwSqjqmzAzV35aR6bMUPnxk= X-Originating-IP: [72.188.224.222] In-Reply-To: X-Mailer: Claws Mail 3.17.1 (GTK+ 2.24.32; x86_64-unknown-linux-gnu) Xref: news.gmane.org gmane.comp.sysutils.supervision.general:2419 Archived-At: On Thu, 27 Dec 2018 09:36:28 +0000 Dmitry Bogatov wrote: > [2018-12-26 03:58] Alex Efros > > Hi! > > > > I'm not sure is it good idea to include .u files in usual rotation > > process at all, and especially handle them just like .s files. If > > several crashes happens for some reason in a short period of time > > this will result in deletion of all log files except last (say) > > 10 .u files, which are usually small and may contain just one line. > > Replacing 10MB of last logs with 10 last log lines doesn't sounds > > like a nice idea. > > > > Possible "right" solution will be to keep same amount of last .u > > files as configured for .s files, i.e. if we've configured to keep > > last 10 files then we may have at most double amount (10 .u files > > and 10 .s files). (I didn't checked mentioned patches, so maybe > > they already works this way.) =20 >=20 > Why would it be wrong to just keep appending to `current' instead of > moving it to `.u' file? (see my patch at end of bug thread) >=20 > And this issue happens not only on crash, it happens after every > termination of svlogd, due any signal. I would agree that SIGKILL is > crash, but issue reproduces with SIGINT and SIGTERM. The right solution is to leave the runit code as-is, until both the exact mechanism and intent of the existing code is understood, and the exact reproduction sequence *in the wild* is completely understood. Until then, any change to runit code would be bandaging the symptom rather than fixing the root cause. And we all know that symptom-bandaging leads to side effects, usually bad ones. The guy who jumpers across a circuit breaker because the circuit breaker flips every few days just might burn down his house. The Bug Filer (BF) disliked that there were too many .u files. That symptom can be fixed in a way that's a couple orders of magnitude less likely to produce side effects. Simply run a program, invoked by cron, that deletes .u files over a certain age, as long as it doesn't delete the latest .u file. This does pretty much what the BF needs, leaves recent .u files available for diagnostics, and doesn't touch any runit code.=20 =46rom what Gerrit wrote you, runit is now pretty much unmaintained, so unless someone steps forward ready, willing and able to master the entire runit code base and architecture, runit code probably shouldn't be messed with. I'll be glad to write the program to be run from the cron job. I can have it for you within 4 days, and I'll put any free software license on it that you/Debian wants. There's another alternative for the BF and anyone else inconvenienced by this symptom: They can switch to s6. In my opinion, runit and s6 are very close cousins, at least compared to the likes of systemd, sysvinit, OpenRC, Busybox init and the like. Unlike runit, s6 is constantly maintained, so any bugs can be solved by the actual author rather than distro packagers. If Debian doesn't yet have an s6 package, perhaps a packager could be found, and a Debian s6 (and s6-rc) package can be made. Thank you so much for packaging runit for Debian. Runit is a wonderful supervisor/init that provides a wonderful alternative to the ancient init, the massively entangled monolithic init, and the init that can't even respawn (or couldn't as of 3 years ago). Keep up the good work. SteveT Steve Litt=20 December 2018 featured book: Rapid Learning for the 21st Century http://www.troubleshooters.com/rl21