unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: guix-devel@gnu.org
Subject: Shepherd log rotation service
Date: Sat, 18 May 2024 23:11:40 +0200	[thread overview]
Message-ID: <87ed9y4ygj.fsf@inria.fr> (raw)

Hello Guix!

I’ve just pushed a simple log rotation service for Shepherd:

  https://git.savannah.gnu.org/cgit/shepherd.git/commit/?h=devel&id=0484726801c2b5c1b7deecb9a96054c2c510ac71

It rotates log files roughly the same way we’ve been doing since the
70’s, but there’s a couple of advantages compared to what we’re
currently doing in Guix System:

  • No need to repeat the name of log files since shepherd already knows
    them via #:log-file (that’s another reason to avoid
    non-shepherd-managed log files).

  • Rotation is race-free: it’s impossible to lose a line of log while
    the file is being rotated.  This is guaranteed by the “logger”,
    which offers a method to atomically close its log file, rename it,
    and open a new empty log file.

  • The log rotation service is a timer so one can inspect it with ‘herd
    status log-rotation’, trigger it with ‘herd trigger log-rotation’,
    and so on.

At this point the log file of shepherd itself, for instance
/var/log/messages, is not handled; this will have to be fixed.

There aren’t many options to specify how to rotate logs (very few
compared to rottlog!), but I figured we’d rather have something simple
that works well and without surprises; we can always add knobs later if
necessary.

Feedback welcome!

Ludo’.


             reply	other threads:[~2024-05-18 21:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-18 21:11 Ludovic Courtès [this message]
2024-05-22 17:54 ` Shepherd log rotation service Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-06-01 13:35   ` Ludovic Courtès
2024-05-23 14:20 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-06-01 13:30   ` Ludovic Courtès

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87ed9y4ygj.fsf@inria.fr \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).