guix-devel
[Top][All Lists]
Advanced

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

rottlog daily test


From: Jan Nieuwenhuizen
Subject: rottlog daily test
Date: Mon, 18 Jul 2016 18:13:24 +0200

Hi

I tried running rottlog by hand and found that it needs `packdir' to be
set, and it needs a config file if you want to run it daily (e.g., for
testing.  Patch attached.

Then I tried to get cron run rottlog each day at 5 doing:

    (use-package-modules admin)
    (use-service-modules mcron)

    (define (rottlog-service)
      (service mcron-service-type
               (mcron-configuration
                (jobs (list (mcron-job
                             (user "root")
                             (specification
                              #~(job '(next-hour '(5))
                                     (lambda ()
                                       (system (string-append rottlog 
"/sbin/rottlog")))))))))))

    
    (operating-system
     ...
      (services ...
       (rottlog-service)))

but I did not see this working.

Greetings,
Jan

>From 192c442b597e9e54bc7ab787f680861f919b37e1 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <address@hidden>
Date: Sat, 18 Jun 2016 22:37:48 +0200
Subject: [PATCH] admin: rottlog: daily

---
 gnu/packages/admin.scm | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 415a35a..e10483e 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -769,11 +769,21 @@ over ssh connections.")
                                               (assoc-ref %outputs "out")
                                               "/etc")
                                "--localstatedir=/var")
-       #:phases (alist-cons-after
-                 'install 'install-info
-                 (lambda _
-                   (zero? (system* "make" "install-info")))
-                 %standard-phases)))
+       #:phases (modify-phases %standard-phases
+                  (add-after 'build 'set-packdir
+                    (lambda _
+                      (substitute* "rc/rc"
+                        (("packdir=\"\"")
+                         "packdir=\"/var/log\""))))
+                  (add-after 'install 'install-daily
+                    (lambda* (#:key outputs #:allow-other-keys)
+                      (let ((out (assoc-ref outputs "out")))
+                        (zero? (system* "mv"
+                                        (string-append out "/etc/weekly")
+                                        (string-append out "/etc/daily"))))))
+                  (add-after 'install 'install-info
+                    (lambda _
+                      (zero? (system* "make" "install-info")))))))
     (native-inputs `(("texinfo" ,texinfo)
                      ("util-linux" ,util-linux))) ; for 'cal'
     (home-page "http://www.gnu.org/software/rottlog/";)
-- 
2.8.4

-- 
Jan Nieuwenhuizen <address@hidden> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar®  http://AvatarAcademy.nl  

reply via email to

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