From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2405 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Bogatov Newsgroups: gmane.linux.debian.devel.bugs.general,gmane.comp.sysutils.supervision.general Subject: Bug#916230: Svlogd: log files named as `timestamp.u' even if there is no processor in place Date: Thu, 20 Dec 2018 18:02:52 +0000 Message-ID: References: <154455071015.11718.14340620820314828.reportbug@lorenz> <20181219092106.7171.qmail@2a19f86b97c12b.315fe32.mid.smarden.org> <154455071015.11718.14340620820314828.reportbug@lorenz> Reply-To: Dmitry Bogatov , 916230@bugs.debian.org 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 1545329057 21291 195.159.176.226 (20 Dec 2018 18:04:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 20 Dec 2018 18:04:17 +0000 (UTC) Cc: Gerrit Pape , Lorenzo Puliti , 916230@bugs.debian.org To: supervision@list.skarnet.org Original-X-From: bounce-debian-bugs-dist=glddb-debian-bugs-dist2=m.gmane.org@lists.debian.org Thu Dec 20 19:04:12 2018 Return-path: Envelope-to: glddb-debian-bugs-dist2@m.gmane.org Original-Received: from bendel.debian.org ([82.195.75.100]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ga2g7-0005Q6-Eu for glddb-debian-bugs-dist2@m.gmane.org; Thu, 20 Dec 2018 19:04:11 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by bendel.debian.org (Postfix) with QMQP id 9CD7821283; Thu, 20 Dec 2018 18:06:22 +0000 (UTC) X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Thu Dec 20 18:06:22 2018 Old-Return-Path: Original-Received: from localhost (localhost [127.0.0.1]) by bendel.debian.org (Postfix) with ESMTP id 4F42B21282 for ; Thu, 20 Dec 2018 18:06:22 +0000 (UTC) X-Virus-Scanned: at lists.debian.org with policy bank bug X-Spam-Score: -4.2 Original-Received: from bendel.debian.org ([127.0.0.1]) by localhost (lists.debian.org [127.0.0.1]) (amavisd-new, port 2525) with ESMTP id geEeO_UTi7Lz for ; Thu, 20 Dec 2018 18:06:19 +0000 (UTC) Original-Received: from buxtehude.debian.org (buxtehude.debian.org [IPv6:2607:f8f0:614:1::1274:39]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "buxtehude.debian.org", Issuer "Debian SMTP CA" (not verified)) by bendel.debian.org (Postfix) with ESMTPS id 165872126C; Thu, 20 Dec 2018 18:06:19 +0000 (UTC) Original-Received: from debbugs by buxtehude.debian.org with local (Exim 4.89) (envelope-from ) id 1ga2i8-0002ug-0G; Thu, 20 Dec 2018 18:06:16 +0000 X-Loop: owner@bugs.debian.org Resent-From: Dmitry Bogatov Resent-To: debian-bugs-dist@lists.debian.org X-Loop: owner@bugs.debian.org Resent-Date: Thu, 20 Dec 2018 18:06:14 +0000 Resent-Message-ID: X-Debian-PR-Message: followup 916230 X-Debian-PR-Package: runit X-Debian-PR-Keywords: confirmed X-Debian-PR-Source: runit Original-Received: via spool by 916230-submit@bugs.debian.org id=B916230.15453289869685 (code B ref 916230); Thu, 20 Dec 2018 18:06:14 +0000 Original-Received: (at 916230) by bugs.debian.org; 20 Dec 2018 18:03:06 +0000 X-Spam-Bayes: score:0.0000 Tokens: new, 19; hammy, 150; neutral, 192; spammy, 0. spammytokens: hammytokens:0.000-+--H*ct:us-ascii, 0.000-+--43PM, 0.000-+--100644, 0.000-+--Hx-spam-relays-external:sk:fencepo, 0.000-+--H*F:U*KAction Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]) by buxtehude.debian.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ga2f4-0002Ve-C5 for 916230@bugs.debian.org; Thu, 20 Dec 2018 18:03:06 +0000 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ga2f1-0002n2-6O for 916230@bugs.debian.org; Thu, 20 Dec 2018 13:03:05 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:41684) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ga2es-0002ds-Nb; Thu, 20 Dec 2018 13:02:54 -0500 Original-Received: from [172.58.11.21] (port=64698 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ga2es-000465-Ak; Thu, 20 Dec 2018 13:02:54 -0500 In-reply-to: <20181219092106.7171.qmail@2a19f86b97c12b.315fe32.mid.smarden.org> Comments: In-reply-to Gerrit Pape message dated "Wed, 19 Dec 2018 09:21:06 +0000." Content-ID: <1173.1545328972.1@neophite> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Debian-Message: from BTS X-Mailing-List: archive/latest/1506797 X-Loop: debian-bugs-dist@lists.debian.org List-Id: List-URL: List-Post: List-Help: List-Subscribe: List-Unsubscribe: Precedence: list Resent-Sender: debian-bugs-dist-request@lists.debian.org Xref: news.gmane.org gmane.linux.debian.devel.bugs.general:1584659 gmane.comp.sysutils.supervision.general:2405 Archived-At: Hello, supervision list! I am Debian maintainer of 'runit' package, and I ask for help with issue, described at 'https://bugs.debian.org/916230'. There is piece of code in svlogd.c, that causes strage behaviour, but it looks it was introduced on puprose. If you know, could you please explain this purpose to me? [2018-12-19 09:21] Gerrit Pape > I'm sorry, can't give you any input, I'm busy with different things > these days. But there're people around knowing the runit programs and > code, you can try to contact them through the mailing list > . Thank you for hint. > On Mon, Dec 17, 2018 at 02:54:43PM +0000, Dmitry Bogatov wrote: > > = > > [2018-12-12 19:39] Dmitry Bogatov > > > I managed to reproduce bug. Seems that .u file appears when svlogd is > > > restarted and there is some .s files, but not always. I plan to debug > > > it this weekend. > > > = > > > Thank you for report. If you have some ideas, how to reproduce bug > > > more reliable, it would be great! > > = > > Offending .u file is created by rename(2) call at line 532, in > > logdir_open() function. It happens, when 'current' file exists, > > non-executable and non-empty. > > = > > Well, this is quite normal state of affairs. When `svlogd' is running, > > `current' file is getting appended, when its size reaches `ld->sizemax' > > (or something like this), it gets renames to @timestamp, and new > > `current' is created. > > = > > So, if I interrupt `svlogd' at any time, but just after rotation, I > > will get this leftover .u file. I am not perfectly sure, but seems that > > `struct logdir` has `size' field, that means current size of log file. > > = > > I believe following patch would solve current issue. But wouldn't > > it cause another problems? There must be reason, why this logic was > > implemented. Gerrit, some input, please? > > = > > diff --git a/runit-2.1.2/src/svlogd.c b/runit-2.1.2/src/svlogd.c > > index fab8441..3f8ead4 100644 > > --- a/runit-2.1.2/src/svlogd.c > > +++ b/runit-2.1.2/src/svlogd.c > > @@ -521,20 +521,7 @@ unsigned int logdir_open(struct logdir *ld, const = char *fn) { > > = > > /* open current */ > > if ((i =3Dstat("current", &st)) !=3D -1) { > > - if (st.st_size && ! (st.st_mode & S_IXUSR)) { > > - ld->fnsave[25] =3D'.'; ld->fnsave[26] =3D'u'; ld->fnsave[27] =3D= 0; > > - do { > > - taia_now(&now); > > - fmt_taia(ld->fnsave, &now); > > - errno =3D0; > > - } while ((stat(ld->fnsave, &st) !=3D -1) || (errno !=3D error_no= ent)); > > - while (rename("current", ld->fnsave) =3D=3D -1) > > - pause2("unable to rename current", ld->name); > > - rmoldest(ld); > > - i =3D-1; > > - } > > - else > > - ld->size =3Dst.st_size; > > + ld->size =3Dst.st_size; > > } > > else > > if (errno !=3D error_noent) { > =