mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
services: virtual-build-machine: Turn GC job into a Shepherd timer.
* gnu/services/virtualization.scm (gc-service-type): New variable. (%virtual-build-machine-operating-system): Use instead of extending ‘mcron-service-type’. Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> Change-Id: I56d7f9293f582269e5a34d91bf4f3edddfa844e0
This commit is contained in:
parent
7cec434865
commit
230f1a9c1c
1 changed files with 18 additions and 4 deletions
|
@ -40,7 +40,6 @@
|
||||||
#:use-module (gnu services base)
|
#:use-module (gnu services base)
|
||||||
#:use-module (gnu services configuration)
|
#:use-module (gnu services configuration)
|
||||||
#:use-module (gnu services dbus)
|
#:use-module (gnu services dbus)
|
||||||
#:use-module (gnu services mcron)
|
|
||||||
#:use-module (gnu services shepherd)
|
#:use-module (gnu services shepherd)
|
||||||
#:use-module (gnu services ssh)
|
#:use-module (gnu services ssh)
|
||||||
#:use-module (gnu services)
|
#:use-module (gnu services)
|
||||||
|
@ -1353,6 +1352,23 @@ that will be listening to receive secret keys on ADDRESS."
|
||||||
(else
|
(else
|
||||||
'("/dev/console")))))
|
'("/dev/console")))))
|
||||||
|
|
||||||
|
(define gc-service-type ;TODO: Factorize.
|
||||||
|
(shepherd-service-type
|
||||||
|
'garbage-collection
|
||||||
|
(lambda _
|
||||||
|
(shepherd-service
|
||||||
|
(provision '(gc))
|
||||||
|
(requirement '(user-processes guix-daemon))
|
||||||
|
(start #~(make-timer-constructor
|
||||||
|
(calendar-event #:minutes '(12))
|
||||||
|
(command
|
||||||
|
'("/run/current-system/profile/bin/guix" "gc" "-F2G"))
|
||||||
|
#:wait-for-termination? #t))
|
||||||
|
(stop #~(make-timer-constructor))
|
||||||
|
(actions (list shepherd-trigger-action))))
|
||||||
|
#t
|
||||||
|
(description "Periodically collect garbage.")))
|
||||||
|
|
||||||
(define %virtual-build-machine-operating-system
|
(define %virtual-build-machine-operating-system
|
||||||
(operating-system
|
(operating-system
|
||||||
(host-name "build-machine")
|
(host-name "build-machine")
|
||||||
|
@ -1385,9 +1401,7 @@ that will be listening to receive secret keys on ADDRESS."
|
||||||
(openssh openssh-sans-x)))
|
(openssh openssh-sans-x)))
|
||||||
|
|
||||||
;; Run GC once per hour.
|
;; Run GC once per hour.
|
||||||
(simple-service 'perdiodic-gc mcron-service-type
|
(service gc-service-type)
|
||||||
(list #~(job "12 * * * *"
|
|
||||||
"guix gc -F 2G")))
|
|
||||||
|
|
||||||
(modify-services %base-services
|
(modify-services %base-services
|
||||||
;; By default, the secret service introduces a
|
;; By default, the secret service introduces a
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue