supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: "Laurent Bercot" <ska-supervision@skarnet.org>
To: supervision@list.skarnet.org
Subject: Re: Log rotation issue with runit
Date: Thu, 27 Dec 2018 11:41:13 +0000	[thread overview]
Message-ID: <em44cf5ce5-c3da-46ca-968f-8327ba63cb6f@elzian> (raw)
In-Reply-To: <E1gcS5d-0001SF-81@eggs.gnu.org>

>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)

On a crash, it is possible that a file you're writing to gets
corrupted. For the integrity of your logs, it's better to move that
potentially corrupted file to another place and start over.
If loggers kept appending to "current" instead, it could have
corrupt information in the middle of a "current" file, which would
them be archived as a .s (intact file), which wouldn't be good.
Please don't change that behaviour - it's correct.

Loggers should not be repeatedly crashing and wiping out your
existing logs by excessive rotations. If you have a repeatedly crashing
logger, something is wrong in your installation (or the way you built
the logger). However, if you cannot trust your installation, a
workaround is to use s6-log, which is very similar to svlogd and
understands a "S" directive, meaning "total size of archived files in
the directory". Using a large "n" value (maximum number of archived
files) and an appropriate "S" value will keep all your logs even in
the case of repeated crashes - which will not happen with s6-log.

--
Laurent



  reply	other threads:[~2018-12-27 11:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-25 13:39 Dmitry Bogatov
2018-12-25 14:57 ` Alex Efros
2018-12-25 18:17 ` Guillermo
2018-12-25 18:30   ` Guillermo
2018-12-26  1:58   ` Alex Efros
2018-12-27  9:36     ` Dmitry Bogatov
2018-12-27 11:41       ` Laurent Bercot [this message]
2018-12-28  6:47         ` Jonathan de Boyne Pollard
2018-12-27 13:47       ` Steve Litt
2018-12-28  1:27         ` Guillermo
2018-12-27 23:39       ` Guillermo
2018-12-29 18:33         ` Dmitry Bogatov
2018-12-29 22:32           ` Guillermo
2018-12-28  6:57     ` Jonathan de Boyne Pollard
2018-12-26  5:05 ` Steve Litt
2018-12-27  9:36   ` Dmitry Bogatov
2018-12-27 13:07     ` Steve Litt
2018-12-29 18:33       ` Dmitry Bogatov
2018-12-30  1:20         ` Steve Litt
2018-12-30 10:04 ` Jonathan de Boyne Pollard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=em44cf5ce5-c3da-46ca-968f-8327ba63cb6f@elzian \
    --to=ska-supervision@skarnet.org \
    --cc=supervision@list.skarnet.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).