guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/03: services: earlyoom: Rotate log files.


From: guix-commits
Subject: 02/03: services: earlyoom: Rotate log files.
Date: Thu, 4 May 2023 15:46:15 -0400 (EDT)

efraim pushed a commit to branch master
in repository guix.

commit f66344ed81c47df6cf4606469b8f4c5732f4b9db
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Thu May 4 21:30:12 2023 +0300

    services: earlyoom: Rotate log files.
    
    * gnu/services/linux.scm (%earlyoom-log-rotation): New variable.
    (earlyoom-service-type): Add service-extension for log rotation.
---
 gnu/services/linux.scm | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm
index 4f28044112..d105c42850 100644
--- a/gnu/services/linux.scm
+++ b/gnu/services/linux.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
-;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2020, 2023 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2021 raid5atemyhomework <raid5atemyhomework@protonmail.com>
 ;;; Copyright © 2021 B. Wilson <elaexuotee@wilsonb.com>
 ;;; Copyright © 2022 Josselin Poiret <dev@jpoiret.xyz>
@@ -30,6 +30,7 @@
   #:use-module (guix i18n)
   #:use-module (guix ui)
   #:use-module (gnu services)
+  #:use-module (gnu services admin)
   #:use-module (gnu services base)
   #:use-module (gnu services configuration)
   #:use-module (gnu services mcron)
@@ -155,13 +156,19 @@ representation."
              #:log-file "/var/log/earlyoom.log"))
    (stop #~(make-kill-destructor))))
 
+(define %earlyoom-log-rotation
+  (list (log-rotation
+         (files '("/var/log/earlyoom.log")))))
+
 (define earlyoom-service-type
   (service-type
    (name 'earlyoom)
    (default-value (earlyoom-configuration))
    (extensions
     (list (service-extension shepherd-root-service-type
-                             (compose list earlyoom-shepherd-service))))
+                             (compose list earlyoom-shepherd-service))
+          (service-extension rottlog-service-type
+                             (const %earlyoom-log-rotation))))
    (description "Run @command{earlyoom}, the Early OOM daemon.")))
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]