From df1b070693fd68cd1cc3993b054dbeb5281c88f2 Mon Sep 17 00:00:00 2001 From: Hilton Chain Date: Thu, 7 Dec 2023 13:07:43 +0800 Subject: [PATCH] services: clash: Rotate logs. * rosenthal/services/child-error.scm (clash-log-rotations): New procedure. (clash-service-type): Extend rottlog-service-type with it. --- rosenthal/services/child-error.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rosenthal/services/child-error.scm b/rosenthal/services/child-error.scm index f2deafc..14090c2 100644 --- a/rosenthal/services/child-error.scm +++ b/rosenthal/services/child-error.scm @@ -91,6 +91,10 @@ (delete-file config-dest)) (symlink #$config config-dest))))) +(define (clash-log-rotations config) + (list (log-rotation + (files (list (clash-configuration-log-file config)))))) + (define clash-shepherd-service (match-record-lambda (clash log-file data-directory config shepherd-provision) @@ -121,7 +125,9 @@ (service-extension activation-service-type clash-activation) (service-extension account-service-type - (const %clash-accounts)))) + (const %clash-accounts)) + (service-extension rottlog-service-type + clash-log-rotations))) (default-value (clash-configuration)) (description "Run Clash.")))