diff mbox

rottlog daily test

Message ID 8737n6divv.fsf@gnu.org
State New
Headers show

Commit Message

Jan Nieuwenhuizen July 18, 2016, 4:13 p.m. UTC
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

Comments

Ludovic Courtès July 19, 2016, 12:59 p.m. UTC | #1
Hello!

Jan Nieuwenhuizen <janneke@gnu.org> skribis:

> From 192c442b597e9e54bc7ab787f680861f919b37e1 Mon Sep 17 00:00:00 2001
> From: Jan Nieuwenhuizen <janneke@gnu.org>
> 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")))))))

On closer inspection, it seems to me we should be using
--sysconfdir=/etc, but still provide the example config files in
OUT/etc.

WDYT?

Thanks,
Ludo’.
Jan Nieuwenhuizen July 19, 2016, 4:23 p.m. UTC | #2
Ludovic Courtès writes:

> On closer inspection, it seems to me we should be using
> --sysconfdir=/etc, but still provide the example config files in
> OUT/etc.
>
> WDYT?

Sounds good.  It would be good to see it really work from mcron*...

Greetings,
Jan
diff mbox

Patch

From 192c442b597e9e54bc7ab787f680861f919b37e1 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
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