diff options
author | Marius Bakke <[email protected]> | 2022-08-11 22:15:22 +0200 |
---|---|---|
committer | Marius Bakke <[email protected]> | 2022-08-11 22:15:22 +0200 |
commit | b50eaa67642ebc25e9c896f2e700c08610e0a5da (patch) | |
tree | e3358208e17a836c2e3cdb3125f815a2ab35c2b8 /gnu/services/admin.scm | |
parent | 7b69cd07408bf64fff026e4597920a90259e3205 (diff) | |
parent | 99b73f60415b282f2be39134f385cbda4840c336 (diff) |
Merge branch 'master' into staging
Diffstat (limited to 'gnu/services/admin.scm')
-rw-r--r-- | gnu/services/admin.scm | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm index 0b4ecaeb83..252bedb0bd 100644 --- a/gnu/services/admin.scm +++ b/gnu/services/admin.scm @@ -40,6 +40,7 @@ log-rotation-files log-rotation-options log-rotation-post-rotate + %default-log-rotation-options rottlog-configuration rottlog-configuration? @@ -82,7 +83,12 @@ (post-rotate log-rotation-post-rotate ;#f | gexp (default #f)) (options log-rotation-options ;list of strings - (default '()))) + (default %default-log-rotation-options))) + +(define %default-log-rotation-options + ;; Default log rotation options: append ".gz" to file names. + '("storefile @FILENAME.@COMP_EXT" + "notifempty")) (define %rotated-files ;; Syslog files subject to rotation. @@ -93,18 +99,21 @@ (list (log-rotation ;syslog files (files %rotated-files) - (options '(;; Run post-rotate once per rotation + (frequency 'weekly) + (options `(;; These files are worth keeping for a few weeks. + "rotate 16" + ;; Run post-rotate once per rotation "sharedscripts" - ;; Append .gz to rotated files - "storefile @FILENAME.@COMP_EXT")) + + ,@%default-log-rotation-options)) ;; Restart syslogd after rotation. (post-rotate #~(let ((pid (call-with-input-file "/var/run/syslog.pid" read))) (kill pid SIGHUP)))) (log-rotation (files '("/var/log/guix-daemon.log")) - (options '("rotate 4" ;don't keep too many of them - "storefile @FILENAME.@COMP_EXT"))))) + (options `("rotate 4" ;don't keep too many of them + ,@%default-log-rotation-options))))) (define (log-rotation->config rotation) "Return a string-valued gexp representing the rottlog configuration snippet |