From: "Ludovic Courtès" <ludo@gnu.org>
To: 32660@debbugs.gnu.org
Subject: [bug#32660] [PATCH 2/2] services: hpcguix-web: Produce a log file and rotate it.
Date: Fri, 7 Sep 2018 23:14:59 +0200 [thread overview]
Message-ID: <20180907211459.16037-2-ludo@gnu.org> (raw)
In-Reply-To: <20180907211459.16037-1-ludo@gnu.org>
* gnu/services/web.scm (%hpcguix-web-log-file)
(%hpcguix-web-log-rotations): New variables.
(hpcguix-web-shepherd-service): Pass #:log-file.
(hpcguix-web-service-type): Extend ROTTLOG-SERVICE-TYPE.
---
gnu/services/web.scm | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 1c613ac8a..0a5b5f425 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -1,6 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 David Thompson <davet@gnu.org>
-;;; Copyright © 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Nils Gillmann <ng0@n0.is>
;;; Copyright © 2016, 2017, 2018 Julien Lepiller <julien@lepiller.eu>
;;; Copyright © 2017 Christopher Baines <mail@cbaines.net>
@@ -27,6 +27,7 @@
(define-module (gnu services web)
#:use-module (gnu services)
#:use-module (gnu services shepherd)
+ #:use-module (gnu services admin)
#:use-module (gnu system pam)
#:use-module (gnu system shadow)
#:use-module (gnu packages admin)
@@ -976,6 +977,14 @@ a webserver.")
(chown home-dir (passwd:uid user) (passwd:gid user))
(chmod home-dir #o755))))
+(define %hpcguix-web-log-file
+ "/var/log/hpcguix-web.log")
+
+(define %hpcguix-web-log-rotations
+ (list (log-rotation
+ (files (list %hpcguix-web-log-file))
+ (frequency 'weekly))))
+
(define (hpcguix-web-shepherd-service config)
(let ((specs (hpcguix-web-configuration-specs config))
(hpcguix-web (hpcguix-web-package config)))
@@ -993,7 +1002,8 @@ a webserver.")
#:group "hpcguix-web"
#:environment-variables
(list "XDG_CACHE_HOME=/var/cache"
- "SSL_CERT_DIR=/etc/ssl/certs")))
+ "SSL_CERT_DIR=/etc/ssl/certs")
+ #:log-file #$%hpcguix-web-log-file))
(stop #~(make-kill-destructor))))))
(define hpcguix-web-service-type
@@ -1005,6 +1015,8 @@ a webserver.")
(const %hpcguix-web-accounts))
(service-extension activation-service-type
(const %hpcguix-web-activation))
+ (service-extension rottlog-service-type
+ (const %hpcguix-web-log-rotations))
(service-extension shepherd-root-service-type
(compose list hpcguix-web-shepherd-service))))))
--
2.18.0
next prev parent reply other threads:[~2018-09-07 21:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-07 21:05 [bug#32660] [PATCH 0/2] Move taylon service to web.scm; add log file for hpcguix-web Ludovic Courtès
2018-09-07 21:14 ` [bug#32660] [PATCH 1/2] services: tailon: Move to (gnu services web) Ludovic Courtès
2018-09-07 21:14 ` Ludovic Courtès [this message]
2018-09-10 10:18 ` bug#32660: [PATCH 0/2] Move taylon service to web.scm; add log file for hpcguix-web Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180907211459.16037-2-ludo@gnu.org \
--to=ludo@gnu.org \
--cc=32660@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).