* rottlog daily test
@ 2016-07-18 16:13 Jan Nieuwenhuizen
2016-07-19 12:59 ` Ludovic Courtès
0 siblings, 1 reply; 3+ messages in thread
From: Jan Nieuwenhuizen @ 2016-07-18 16:13 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: Type: text/plain, Size: 858 bytes --]
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
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-admin-rottlog-daily.patch --]
[-- Type: text/x-patch, Size: 1855 bytes --]
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
[-- Attachment #3: Type: text/plain, Size: 154 bytes --]
--
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.nl
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: rottlog daily test
2016-07-18 16:13 rottlog daily test Jan Nieuwenhuizen
@ 2016-07-19 12:59 ` Ludovic Courtès
2016-07-19 16:23 ` Jan Nieuwenhuizen
0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2016-07-19 12:59 UTC (permalink / raw)
To: Jan Nieuwenhuizen; +Cc: guix-devel
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’.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-07-19 16:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-18 16:13 rottlog daily test Jan Nieuwenhuizen
2016-07-19 12:59 ` Ludovic Courtès
2016-07-19 16:23 ` Jan Nieuwenhuizen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.