all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Shepherd log rotation service
@ 2024-05-18 21:11 Ludovic Courtès
  2024-05-22 17:54 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ludovic Courtès @ 2024-05-18 21:11 UTC (permalink / raw)
  To: guix-devel

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’.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-08-12  9:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-18 21:11 Shepherd log rotation service Ludovic Courtès
2024-05-22 17:54 ` 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
2024-07-21 23:45 ` Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-08-12  9:28   ` Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.