Toggle diff (389 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 658081a9ed..952248f2a0 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -20795,6 +20795,9 @@ Log Rotation
log-rotation} and trigger rotation manually with @command{herd trigger
log-rotation}.
+This service is part of @code{%base-services}, and thus enabled by
+default, with the default settings.
+
@defvar log-rotation-service-type
This is the type of the log rotation service. Its associated value must
be a @code{log-rotation-configuration} record, as discussed below.
@@ -20838,8 +20841,6 @@ Log Rotation
rotation tool (@pxref{Top,,, rottlog, GNU Rot[t]log Manual}), is also
provided.
-This service is part of @code{%base-services}, and thus enabled by
-default, with the default settings, for commonly encountered log files.
The example below shows how to extend it with an additional
@dfn{rotation}, should you need to do that (usually, services that
produce log files already take care of that):
diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm
index 5fb2fcb6e0..7f570f67e4 100644
--- a/gnu/services/admin.scm
+++ b/gnu/services/admin.scm
@@ -634,19 +634,12 @@ (define (unattended-upgrade-shepherd-services config)
(documentation "Trigger unattended system upgrade.")
(procedure #~trigger-timer)))))))
-(define (unattended-upgrade-log-rotations config)
- (list (log-rotation
- (files
- (list (unattended-upgrade-configuration-log-file config))))))
-
(define unattended-upgrade-service-type
(service-type
(name 'unattended-upgrade)
(extensions
(list (service-extension shepherd-root-service-type
- unattended-upgrade-shepherd-services)
- (service-extension rottlog-service-type
- unattended-upgrade-log-rotations)))
+ unattended-upgrade-shepherd-services)))
(description
"Periodically upgrade the system from the current configuration.")
(default-value (unattended-upgrade-configuration))))
diff --git a/gnu/services/audio.scm b/gnu/services/audio.scm
index 5d2cd56a17..6515d53dbd 100644
--- a/gnu/services/audio.scm
+++ b/gnu/services/audio.scm
@@ -579,17 +579,6 @@ (define (mpd-serialize-configuration configuration)
"mpd.conf"
(serialize-configuration configuration mpd-configuration-fields)))
-(define (mpd-log-rotation config)
- (match-record config <mpd-configuration>
- (log-file)
- (if (string=? "syslog" log-file)
- '() ;nothing to do
- (list (log-rotation
- (files (list log-file))
- (post-rotate #~(begin
- (use-modules (gnu services herd))
- (with-shepherd-action 'mpd ('reopen) #f))))))))
-
(define (mpd-shepherd-service config)
(match-record config <mpd-configuration>
(user package shepherd-requirement
@@ -675,8 +664,7 @@ (define mpd-service-type
(extensions
(list (service-extension shepherd-root-service-type
(compose list mpd-shepherd-service))
- (service-extension account-service-type mpd-accounts)
- (service-extension rottlog-service-type mpd-log-rotation)))
+ (service-extension account-service-type mpd-accounts)))
(default-value (mpd-configuration))))
@@ -953,14 +941,6 @@ (define (mympd-accounts config)
user)))
(list user group))))
-(define (mympd-log-rotation config)
- (match-record config <mympd-configuration>
- (log-to)
- (if (maybe-value-set? log-to)
- (list (log-rotation
- (files (list log-to))))
- '())))
-
(define mympd-service-type
(service-type
(name 'mympd)
@@ -970,8 +950,6 @@ (define mympd-service-type
(service-extension account-service-type
mympd-accounts)
(service-extension special-files-service-type
- mympd-serialize-configuration)
- (service-extension rottlog-service-type
- mympd-log-rotation)))
+ mympd-serialize-configuration)))
(description "Run myMPD, a frontend for MPD. (Music Player Daemon)")
(default-value (mympd-configuration))))
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 6473e1a91a..0a2b7e069d 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -2297,12 +2297,6 @@ (define %guix-publish-accounts
(home-directory "/var/empty")
(shell (file-append shadow "/sbin/nologin")))))
-(define %guix-publish-log-rotations
- (list (log-rotation
- (files (list "/var/log/guix-publish.log"))
- (options `("rotate 4" ;don't keep too many of them
- ,@%default-log-rotation-options)))))
-
(define (guix-publish-activation config)
(let ((cache (guix-publish-configuration-cache config)))
(if cache
@@ -2324,8 +2318,6 @@ (define guix-publish-service-type
guix-publish-shepherd-service)
(service-extension account-service-type
(const %guix-publish-accounts))
- (service-extension rottlog-service-type
- (const %guix-publish-log-rotations))
(service-extension activation-service-type
guix-publish-activation)))
(default-value (guix-publish-configuration))
@@ -3679,7 +3671,7 @@ (define %base-services
(service guix-service-type)
(service nscd-service-type)
- (service rottlog-service-type)
+ (service log-rotation-service-type)
;; Periodically delete old build logs.
(service log-cleanup-service-type
diff --git a/gnu/services/cuirass.scm b/gnu/services/cuirass.scm
index cc5cd62672..6643fd2f35 100644
--- a/gnu/services/cuirass.scm
+++ b/gnu/services/cuirass.scm
@@ -331,20 +331,6 @@ (define (cuirass-activation config)
(when #$remote-cache
(chown #$remote-cache uid gid)))))))
-(define (cuirass-log-rotations config)
- "Return the list of log rotations that corresponds to CONFIG."
- (list (log-rotation
- (files (append (list (cuirass-configuration-log-file config)
- (cuirass-configuration-web-log-file config))
- (let ((server
- (cuirass-configuration-remote-server config)))
- (if server
- (list (cuirass-remote-server-log-file server))
- '()))))
- (frequency 'weekly)
- (options `("rotate 40" ;worth keeping
- ,@%default-log-rotation-options)))))
-
(define cuirass-service-type
(service-type
(name 'cuirass)
@@ -352,7 +338,6 @@ (define cuirass-service-type
(list
(service-extension profile-service-type ;for 'info cuirass'
(compose list cuirass-configuration-cuirass))
- (service-extension rottlog-service-type cuirass-log-rotations)
(service-extension activation-service-type cuirass-activation)
(service-extension shepherd-root-service-type cuirass-shepherd-service)
(service-extension account-service-type cuirass-account)
@@ -445,14 +430,6 @@ (define (cuirass-remote-worker-shepherd-service config)
#:log-file #$log-file))
(stop #~(make-kill-destructor))))))
-(define (cuirass-remote-worker-log-rotations config)
- "Return the list of log rotations that corresponds to CONFIG."
- (list (log-rotation
- (files (list (cuirass-remote-worker-log-file config)))
- (frequency 'weekly)
- (options `("rotate 4" ;don't keep too many of them
- ,@%default-log-rotation-options)))))
-
(define cuirass-remote-worker-service-type
(service-type
(name 'cuirass-remote-worker)
@@ -460,8 +437,6 @@ (define cuirass-remote-worker-service-type
(list (service-extension shepherd-root-service-type
cuirass-remote-worker-shepherd-service)
(service-extension account-service-type
- (const %cuirass-remote-worker-accounts))
- (service-extension rottlog-service-type
- cuirass-remote-worker-log-rotations)))
+ (const %cuirass-remote-worker-accounts))))
(description
"Run the Cuirass remote build worker service.")))
diff --git a/gnu/services/file-sharing.scm b/gnu/services/file-sharing.scm
index 75e99f20b7..6b25cd420f 100644
--- a/gnu/services/file-sharing.scm
+++ b/gnu/services/file-sharing.scm
@@ -701,10 +701,6 @@ (define %transmission-daemon-accounts
(shell (file-append shadow "/sbin/nologin"))
(system? #t))))
-(define %transmission-daemon-log-rotations
- (list (log-rotation
- (files (list %transmission-daemon-log-file)))))
-
(define (transmission-daemon-computed-settings-file config)
"Return a @code{computed-file} object that, when unquoted in a G-expression,
produces a Transmission settings file (@file{settings.json}) matching CONFIG."
@@ -785,8 +781,6 @@ (define transmission-daemon-service-type
transmission-daemon-shepherd-service)
(service-extension account-service-type
(const %transmission-daemon-accounts))
- (service-extension rottlog-service-type
- (const %transmission-daemon-log-rotations))
(service-extension activation-service-type
transmission-daemon-activation)))
(default-value (transmission-daemon-configuration))
diff --git a/gnu/services/linux.scm b/gnu/services/linux.scm
index 9955a11e64..e683da6bac 100644
--- a/gnu/services/linux.scm
+++ b/gnu/services/linux.scm
@@ -181,19 +181,13 @@ (define (earlyoom-shepherd-service config)
#:log-file "/var/log/earlyoom.log"))
(stop #~(make-kill-destructor))))
-(define %earlyoom-log-rotation
- (list (log-rotation
- (files '("/var/log/earlyoom.log")))))
-
(define earlyoom-service-type
(service-type
(name 'earlyoom)
(default-value (earlyoom-configuration))
(extensions
(list (service-extension shepherd-root-service-type
- (compose list earlyoom-shepherd-service))
- (service-extension rottlog-service-type
- (const %earlyoom-log-rotation))))
+ (compose list earlyoom-shepherd-service))))
(description "Run @command{earlyoom}, a daemon that quickly responds to
@acronym{OOM, out-of-memory} conditions by terminating relevant processes.")))
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 76563be14f..44e93ebddf 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -496,11 +496,6 @@ (define dhcpd-service-type
;;; NTP.
;;;
-
-(define %ntp-log-rotation
- (list (log-rotation
- (files '("/var/log/ntpd.log")))))
-
(define ntp-server-types (make-enumeration
'(pool
server
@@ -634,9 +629,7 @@ (define ntp-service-type
(service-extension account-service-type
(const %ntp-accounts))
(service-extension activation-service-type
- ntp-service-activation)
- (service-extension rottlog-service-type
- (const %ntp-log-rotation))))
+ ntp-service-activation)))
(description
"Run the @command{ntpd}, the Network Time Protocol (NTP)
daemon of the @uref{http://www.ntp.org, Network Time Foundation}. The daemon
@@ -745,9 +738,7 @@ (define openntpd-service-type
(service-extension profile-service-type
(compose list openntpd-configuration-openntpd))
(service-extension activation-service-type
- openntpd-service-activation)
- (service-extension rottlog-service-type
- (const %ntp-log-rotation))))
+ openntpd-service-activation)))
(default-value (openntpd-configuration))
(description
"Run the @command{ntpd}, the Network Time Protocol (NTP)
@@ -1699,10 +1690,6 @@ (define (connman-shepherd-service config)
#:log-file "/var/log/connman.log"))
(stop #~(make-kill-destructor)))))))
-(define %connman-log-rotation
- (list (log-rotation
- (files '("/var/log/connman.log")))))
-
(define connman-service-type
(let ((connman-package (compose list connman-configuration-connman)))
(service-type (name 'connman)
@@ -1717,9 +1704,7 @@ (define connman-service-type
connman-activation)
;; Add connman to the system profile.
(service-extension profile-service-type
- connman-package)
- (service-extension rottlog-service-type
- (const %connman-log-rotation))))
+ connman-package)))
(default-value (connman-configuration))
(description
"Run @url{https://01.org/connman,Connman},
@@ -1960,18 +1945,12 @@ (define* (hostapd-shepherd-services config #:key (requirement '()))
#:log-file "/var/log/hostapd.log"))
(stop #~(make-kill-destructor)))))
-(define %hostapd-log-rotation
- (list (log-rotation
- (files '("/var/log/hostapd.log")))))
-
(define hostapd-service-type
(service-type
(name 'hostapd)
(extensions
(list (service-extension shepherd-root-service-type
- hostapd-shepherd-services)
- (service-extension rottlog-service-type
- (const %hostapd-log-rotation))))
+ hostapd-shepherd-services)))
(description
"Run the @uref{https://w1.fi/hostapd/, hostapd} daemon for Wi-Fi access
points and authentication servers.")))
@@ -2271,10 +2250,6 @@ (define (pagekite-shepherd-service config)
;; SIGTERM doesn't always work for some reason.
(stop #~(make-kill-destructor SIGINT))))))
-(define %pagekite-log-rotation
- (list (log-rotation
- (files '("/var/log/pagekite.log")))))
-
(define %pagekite-accounts
(list (user-group (name "pagekite") (system? #t))
(user-account
@@ -2293,9 +2268,7 @@ (define pagekite-service-type
(list (service-extension shepherd-root-service-type
(compose list pagekite-shepherd-service))
(service-extension account-service-type
- (const %pagekite-accounts))
- (service-extension rottlog-service-type
- (const %pagekite-log-rotation))))
+ (const %pagekite-accounts))))
(description
"Run @url{https://pagekite.net/,PageKite}, a tunneling solution to make
local servers publicly accessible on the web, even behind NATs and firewalls.")))
@@ -2386,10 +2359,6 @@ (define (yggdrasil-shepherd-service config)
#:group "yggdrasil"))
(stop #~(make-kill-destructor)))))
-(define %yggdrasil-log-rotation
- (list (log-rotation
- (files '("/var/log/yggdrasil.log")))))
-
(define %yggdrasil-accounts
(list (user-group (name "yggdrasil") (system? #t))))
@@ -2405,9 +2374,7 @@ (define yggdrasil-service-type
(service-extension account-service-type
(const %yggdrasil-accounts))
(service-extension profile-service-type
- (compose list yggdrasil-configuration-package))
- (service-extension rottlog-service-type
- (const %yggdrasil-log-rotation))))))
+ (compose list yggdrasil-configuration-package))))))
;;;
@@ -2477,10 +2444,6 @@ (define (ipfs-shepherd-service config)
#:environment-variables #$%ipfs-environment))
(stop #~(make-kill-destructor)))))
-(define %ipfs-log-rotation
- (list (log-rotation
- (files '("/var/log/ipfs.log")))))
-
(define (%ipfs-activation config)
"Return an activation gexp for IPFS with CONFIG"
(define (exec-command . args)
@@ -2536,9 +2499,7 @@ (define ipfs-service-type
(service-extension activation-service-type
%ipfs-activation)
(service-extension shepherd-root-service-type
- ipfs-shepherd-service)
- (service-extension rottlog-service-type
-