supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* Bug#916230: Svlogd: log files named as `timestamp.u' even if there is no processor in place
       [not found]     ` <20181219092106.7171.qmail@2a19f86b97c12b.315fe32.mid.smarden.org>
@ 2018-12-20 18:02       ` Dmitry Bogatov
  0 siblings, 0 replies; only message in thread
From: Dmitry Bogatov @ 2018-12-20 18:02 UTC (permalink / raw)
  To: supervision; +Cc: Gerrit Pape, Lorenzo Puliti, 916230


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 <pape@dbnbgs.smarden.org>
> 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
> <supervision@list.skarnet.org> .

Thank you for hint.

> On Mon, Dec 17, 2018 at 02:54:43PM +0000, Dmitry Bogatov wrote:
> > 
> > [2018-12-12 19:39] Dmitry Bogatov <KAction@debian.org>
> > > 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 =stat("current", &st)) != -1) {
> > -    if (st.st_size && ! (st.st_mode & S_IXUSR)) {
> > -      ld->fnsave[25] ='.'; ld->fnsave[26] ='u'; ld->fnsave[27] =0;
> > -      do {
> > -        taia_now(&now);
> > -        fmt_taia(ld->fnsave, &now);
> > -        errno =0;
> > -      } while ((stat(ld->fnsave, &st) != -1) || (errno != error_noent));
> > -      while (rename("current", ld->fnsave) == -1)
> > -        pause2("unable to rename current", ld->name);
> > -      rmoldest(ld);
> > -      i =-1;
> > -    }
> > -    else
> > -      ld->size =st.st_size;
> > +    ld->size =st.st_size;
> >    }
> >    else
> >      if (errno != error_noent) {
> 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-12-20 18:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <154455071015.11718.14340620820314828.reportbug@lorenz>
     [not found] ` <E1gXAMK-0007K2-Pf@eggs.gnu.org>
     [not found]   ` <E1gYuI9-0001Kk-4Z@eggs.gnu.org>
     [not found]     ` <20181219092106.7171.qmail@2a19f86b97c12b.315fe32.mid.smarden.org>
2018-12-20 18:02       ` Bug#916230: Svlogd: log files named as `timestamp.u' even if there is no processor in place Dmitry Bogatov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).