cbaines pushed a commit to branch master
in repository maintenance.

commit c69964246903c1870f9e7d7c6bd49baae27f8c5a
Author: Christopher Baines <m...@cbaines.net>
AuthorDate: Wed Jun 5 11:53:54 2024 +0100

    hydra: bayfront: Start rotating NGinx logs.
    
    More configuration is needed, but this is the big one.
    
    * hydra/bayfront.scm (%nginx-log-rotation): New variable.
    [services]: Add %nginx-log-rotation.
---
 hydra/bayfront.scm | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/hydra/bayfront.scm b/hydra/bayfront.scm
index fe16f0e3..b97c1c6d 100644
--- a/hydra/bayfront.scm
+++ b/hydra/bayfront.scm
@@ -1074,6 +1074,20 @@ proxy_set_header  Via  $via;"
          (raw-content
           (list "return 308 https://$host$request_uri;";)))))
 
+(define %nginx-log-rotation
+  (simple-service
+   'nginx-log-rotation
+   rottlog-service-type
+   (list (log-rotation
+          (files (list "/var/log/nginx/bordeaux.access.log.gz"))
+          (options
+           '("storefile @FILENAME"
+             "nocompress"
+             "notifempty"))
+          (post-rotate #~(let ((pid (call-with-input-file "/var/run/nginx/pid"
+                                      read)))
+                           (kill pid SIGUSR1)))))))
+
 
 (define %guix-build-coordinator-configuration
   (let* ((data.guix.gnu.org-build-event-destination
@@ -1609,6 +1623,8 @@ proxy_set_header  Via  $via;"
                        %coordinator.bayfront.guix.gnu.org-nginx-servers
                        %coordinator.bordeaux.guix.gnu.org-nginx-servers))))
 
+    %nginx-log-rotation
+
     (service nar-herder-service-type
              (nar-herder-configuration
               ;; To make it easy for the guix-build-coordinator hooks

Reply via email to