Hi Felix,

Felix Lechner <felix.lech...@lease-up.com> skribis:

> On Sat, May 18 2024, Ludovic Courtès wrote:
>
>> I’ve just pushed a simple log rotation service for Shepherd:
>
> I have a patch removing rottlog from all Guix "services" that use the
> Shepherd's :log-file feature, which works fine.  Do I need to provide a
> Guix "service" for the log rotation?

Nice, you’re ahead of me! :-)

Here’s how you can provide the log rotation service in your Guix System
config:

--8<---------------cut here---------------start------------->8---
(define log-rotation-service
  (simple-service 'shepherd-log-rotation
                  shepherd-root-service-type
                  (list (shepherd-service
                         (provision '(log-rotation))
                         (modules '((shepherd service log-rotation)))
                         (free-form #~(log-rotation-service))))))


(operating-system
  ;; …
  (services (append (list log-rotation-service) …)))
--8<---------------cut here---------------end--------------->8---

>From there you can check ‘herd files log-rotation’ etc.

(In my config I was too lazy to remove rottlog, so I actually have
both…)

Ludo’.

Reply via email to