Update rotation after rottlog is removed

Julien LepillerFri Jun 20 08:45:07+0200 2025

a069dda

Update rotation after rottlog is removed

modules/config/os.scm

6565
                 `(("tyreunom" ,(local-file "../../keys/tyreunom.pub"))))))
6666
    (simple-service 'motd-service etc-service-type
6767
      `(("motd" ,(local-file (string-append "motd/" host-name)))))
68+
    (simple-service 'my-rotations log-rotation-service-type
69+
                     server-rotations)
6870
    (modify-services %base-services
69-
      (rottlog-service-type config =>
70-
        server-rotation-service-config)
7171
      (login-service-type config =>
7272
        (login-configuration
7373
          (inherit config)

8787
        (platforms (lookup-qemu-platforms "arm" "aarch64" "i686" "ppc"))))
8888
    (udev-rules-service 'android android-udev-rules #:groups '("adbusers"))
8989
    (modify-services %desktop-services
90-
      (rottlog-service-type config =>
91-
        desktop-rotation-service-config)
9290
      (gdm-service-type config =>
9391
       (gdm-configuration
9492
         (inherit config)

modules/config/rotation.scm

2222
(define-module (config rotation)
2323
  #:use-module (gnu services)
2424
  #:use-module (gnu services admin)
25-
  #:export (server-rotation-service-config
26-
            desktop-rotation-service-config))
25+
  #:export (server-rotations
26+
            base-rotations))
2727
2828
(define base-rotations
29-
  (list
30-
    (log-rotation
31-
      ;; What about /var/log/guix?
32-
      (files '("/var/log/guix-daemon.log"))
33-
      (frequency 'daily)
34-
      (options '("rotate 1" "log_rotate")))
35-
    (log-rotation
36-
      (files '("/var/log/mcron.log"))
37-
      (frequency 'weekly)
38-
      (options '("rotate 2" "log_rotate")))
39-
    (log-rotation
40-
      (files
41-
        (map
42-
          (lambda (<>) (string-append "/var/log/" <>))
43-
          '("debug" "lastlog" "messages" "secure" "wtmp")))
44-
      (frequency 'weekly)
45-
      (options '("rotate 4" "log_rotate")))
46-
    (log-rotation
47-
      (files '("/var/log/shepherd.log"))
48-
      (frequency 'daily)
49-
      (options '("rotate 1" "log_rotate")))))
29+
  (list "/var/log/guix-daemon.log"
30+
        "/var/log/mcron.log"
31+
        "/var/log/debug"
32+
        "/var/log/lastlog"
33+
        "/var/log/messages"
34+
        "/var/log/secure"
35+
        "/var/log/wtmp"
36+
        "/var/log/shepherd.log"))
5037
51-
(define server-rotation-service-config
52-
  (rottlog-configuration
53-
    (rotations
54-
      (append
55-
        (list
56-
          (log-rotation
57-
            (files '("/var/log/letsencrypt/letsencrypt.log"))
58-
            (frequency 'daily)
59-
            (options '("rotate 30" "log_rotate" "nocompress")))
60-
          (log-rotation
61-
            (files '("/var/log/maillog"))
62-
            (options '("rotate 5" "log_rotate"))
63-
            (frequency 'daily))
64-
          (log-rotation
65-
            (files '("/var/log/nginx/access.log" "/var/log/nginx/error.log"))
66-
            (frequency 'weekly)
67-
            (options '("rotate 1" "log_rotate" "nocompress"))))
68-
        base-rotations))))
69-
70-
(define desktop-rotation-service-config
71-
  (rottlog-configuration
72-
    (rotations base-rotations)))
38+
(define server-rotations
39+
  (append
40+
    base-rotations
41+
    (list
42+
      "/var/log/letsencrypt/letsencrypt.log"
43+
      "/var/log/maillog"
44+
      "/var/log/nginx/access.log"
45+
      "/var/log/nginx/error.log")))