services: shepherd: 'shepherd-service-type' requires documentation.
* gnu/services/shepherd.scm (shepherd-service-type): Require a 'description' form. * gnu/services/base.scm (root-file-system-service-type) (rngd-service-type, host-name-service-type): (virtual-terminal-service-type, console-keymap-service-type) (syslog-service-type, swap-service-type) (kmscon-service-type): Add description. * gnu/services/networking.scm (dhcp-client-service-type): Likewise. * gnu/system/install.scm (cow-store-service-type): Likewise. * gnu/system/linux-container.scm (dummy-networking-service-type): Likewise. * gnu/system/mapped-devices.scm (device-mapping-service-type): Likewise. * tests/guix-system.sh: Likewise.master
parent
e9f3a800e2
commit
0d22fc8d36
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
|
;;; Copyright © 2015, 2016 Alex Kost <alezost@gmail.com>
|
||||||
;;; Copyright © 2015, 2016, 2020 Mark H Weaver <mhw@netris.org>
|
;;; Copyright © 2015, 2016, 2020 Mark H Weaver <mhw@netris.org>
|
||||||
;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
|
;;; Copyright © 2015 Sou Bunnbu <iyzsong@gmail.com>
|
||||||
|
@ -279,7 +279,9 @@ system objects.")))
|
||||||
|
|
||||||
(define root-file-system-service-type
|
(define root-file-system-service-type
|
||||||
(shepherd-service-type 'root-file-system
|
(shepherd-service-type 'root-file-system
|
||||||
(const %root-file-system-shepherd-service)))
|
(const %root-file-system-shepherd-service)
|
||||||
|
(description "Take care of syncing the root file
|
||||||
|
system and of remounting it read-only when the system shuts down.")))
|
||||||
|
|
||||||
(define (root-file-system-service)
|
(define (root-file-system-service)
|
||||||
"Return a service whose sole purpose is to re-mount read-only the root file
|
"Return a service whose sole purpose is to re-mount read-only the root file
|
||||||
|
@ -570,7 +572,9 @@ down.")))
|
||||||
(requirement '(udev))
|
(requirement '(udev))
|
||||||
(provision '(trng))
|
(provision '(trng))
|
||||||
(start #~(make-forkexec-constructor '#$rngd-command))
|
(start #~(make-forkexec-constructor '#$rngd-command))
|
||||||
(stop #~(make-kill-destructor))))))
|
(stop #~(make-kill-destructor))))
|
||||||
|
(description "Run the @command{rngd} random number generation daemon to
|
||||||
|
supply entropy to the kernel's pool.")))
|
||||||
|
|
||||||
(define* (rngd-service #:key
|
(define* (rngd-service #:key
|
||||||
(rng-tools rng-tools)
|
(rng-tools rng-tools)
|
||||||
|
@ -597,7 +601,8 @@ to add @var{device} to the kernel's entropy pool. The service will fail if
|
||||||
(provision '(host-name))
|
(provision '(host-name))
|
||||||
(start #~(lambda _
|
(start #~(lambda _
|
||||||
(sethostname #$name)))
|
(sethostname #$name)))
|
||||||
(one-shot? #t)))))
|
(one-shot? #t)))
|
||||||
|
(description "Initialize the machine's host name.")))
|
||||||
|
|
||||||
(define (host-name-service name)
|
(define (host-name-service name)
|
||||||
"Return a service that sets the host name to @var{name}."
|
"Return a service that sets the host name to @var{name}."
|
||||||
|
@ -626,7 +631,8 @@ to add @var{device} to the kernel's entropy pool. The service will fail if
|
||||||
(display 1 port))))
|
(display 1 port))))
|
||||||
#t))
|
#t))
|
||||||
(stop #~(const #f)))))
|
(stop #~(const #f)))))
|
||||||
#t)) ;default to UTF-8
|
#t ;default to UTF-8
|
||||||
|
(description "Ensure the Linux virtual terminals run in UTF-8 mode.")))
|
||||||
|
|
||||||
(define console-keymap-service-type
|
(define console-keymap-service-type
|
||||||
(shepherd-service-type
|
(shepherd-service-type
|
||||||
|
@ -638,7 +644,10 @@ to add @var{device} to the kernel's entropy pool. The service will fail if
|
||||||
(start #~(lambda _
|
(start #~(lambda _
|
||||||
(zero? (system* #$(file-append kbd "/bin/loadkeys")
|
(zero? (system* #$(file-append kbd "/bin/loadkeys")
|
||||||
#$@files))))
|
#$@files))))
|
||||||
(respawn? #f)))))
|
(respawn? #f)))
|
||||||
|
(description "@emph{This service is deprecated in favor of the
|
||||||
|
@code{keyboard-layout} field of @code{operating-system}.} Load the given list
|
||||||
|
of console keymaps with @command{loadkeys}.")))
|
||||||
|
|
||||||
(define-deprecated (console-keymap-service #:rest files)
|
(define-deprecated (console-keymap-service #:rest files)
|
||||||
#f
|
#f
|
||||||
|
@ -1341,7 +1350,9 @@ Service Switch}, for an example."
|
||||||
(pid (spawn)))
|
(pid (spawn)))
|
||||||
(umask mask)
|
(umask mask)
|
||||||
pid))))
|
pid))))
|
||||||
(stop #~(make-kill-destructor))))))
|
(stop #~(make-kill-destructor))))
|
||||||
|
(description "Run the syslog daemon, @command{syslogd}, which is
|
||||||
|
responsible for logging system messages.")))
|
||||||
|
|
||||||
;; Snippet adapted from the GNU inetutils manual.
|
;; Snippet adapted from the GNU inetutils manual.
|
||||||
(define %default-syslog.conf
|
(define %default-syslog.conf
|
||||||
|
@ -2207,7 +2218,8 @@ instance."
|
||||||
(when device
|
(when device
|
||||||
(restart-on-EINTR (swapoff device)))
|
(restart-on-EINTR (swapoff device)))
|
||||||
#f)))
|
#f)))
|
||||||
(respawn? #f))))))
|
(respawn? #f))))
|
||||||
|
(description "Turn on the virtual memory swap area.")))
|
||||||
|
|
||||||
(define (swap-service device)
|
(define (swap-service device)
|
||||||
"Return a service that uses @var{device} as a swap device."
|
"Return a service that uses @var{device} as a swap device."
|
||||||
|
@ -2321,7 +2333,9 @@ This service is not part of @var{%base-services}."
|
||||||
(requirement '(user-processes udev dbus-system))
|
(requirement '(user-processes udev dbus-system))
|
||||||
(provision (list (symbol-append 'term- (string->symbol virtual-terminal))))
|
(provision (list (symbol-append 'term- (string->symbol virtual-terminal))))
|
||||||
(start #~(make-forkexec-constructor #$kmscon-command))
|
(start #~(make-forkexec-constructor #$kmscon-command))
|
||||||
(stop #~(make-kill-destructor)))))))
|
(stop #~(make-kill-destructor)))))
|
||||||
|
(description "Start the @command{kmscon} virtual terminal emulator for the
|
||||||
|
Linux @dfn{kernel mode setting} (KMS).")))
|
||||||
|
|
||||||
(define-record-type* <static-networking>
|
(define-record-type* <static-networking>
|
||||||
static-networking make-static-networking
|
static-networking make-static-networking
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
||||||
;;; Copyright © 2016, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
|
;;; Copyright © 2016, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
|
||||||
;;; Copyright © 2016 John Darrington <jmd@gnu.org>
|
;;; Copyright © 2016 John Darrington <jmd@gnu.org>
|
||||||
|
@ -283,7 +283,9 @@ fe80::1%lo0 apps.facebook.com\n")
|
||||||
(and (zero? (cdr (waitpid pid)))
|
(and (zero? (cdr (waitpid pid)))
|
||||||
(read-pid-file #$pid-file)))))
|
(read-pid-file #$pid-file)))))
|
||||||
(stop #~(make-kill-destructor))))
|
(stop #~(make-kill-destructor))))
|
||||||
isc-dhcp))
|
isc-dhcp
|
||||||
|
(description "Run @command{dhcp}, a Dynamic Host Configuration
|
||||||
|
Protocol (DHCP) client, on all the non-loopback network interfaces.")))
|
||||||
|
|
||||||
(define-deprecated (dhcp-client-service #:key (dhcp isc-dhcp))
|
(define-deprecated (dhcp-client-service #:key (dhcp isc-dhcp))
|
||||||
dhcp-client-service-type
|
dhcp-client-service-type
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2013, 2014, 2015, 2016, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2013, 2014, 2015, 2016, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
|
;;; Copyright © 2017 Clément Lassieur <clement@lassieur.org>
|
||||||
;;; Copyright © 2018 Carlo Zancanaro <carlo@zancanaro.id.au>
|
;;; Copyright © 2018 Carlo Zancanaro <carlo@zancanaro.id.au>
|
||||||
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
||||||
|
@ -119,23 +119,25 @@ ensuring they are started and stopped in the right order.")))
|
||||||
(service shepherd-root-service-type '()))
|
(service shepherd-root-service-type '()))
|
||||||
|
|
||||||
(define-syntax shepherd-service-type
|
(define-syntax shepherd-service-type
|
||||||
(syntax-rules ()
|
(syntax-rules (description)
|
||||||
"Return a <service-type> denoting a simple shepherd service--i.e., the type
|
"Return a <service-type> denoting a simple shepherd service--i.e., the type
|
||||||
for a service that extends SHEPHERD-ROOT-SERVICE-TYPE and nothing else. When
|
for a service that extends SHEPHERD-ROOT-SERVICE-TYPE and nothing else. When
|
||||||
DEFAULT is given, use it as the service's default value."
|
DEFAULT is given, use it as the service's default value."
|
||||||
((_ service-name proc default)
|
((_ service-name proc default (description text))
|
||||||
(service-type
|
(service-type
|
||||||
(name service-name)
|
(name service-name)
|
||||||
(extensions
|
(extensions
|
||||||
(list (service-extension shepherd-root-service-type
|
(list (service-extension shepherd-root-service-type
|
||||||
(compose list proc))))
|
(compose list proc))))
|
||||||
(default-value default)))
|
(default-value default)
|
||||||
((_ service-name proc)
|
(description text)))
|
||||||
|
((_ service-name proc (description text))
|
||||||
(service-type
|
(service-type
|
||||||
(name service-name)
|
(name service-name)
|
||||||
(extensions
|
(extensions
|
||||||
(list (service-extension shepherd-root-service-type
|
(list (service-extension shepherd-root-service-type
|
||||||
(compose list proc))))))))
|
(compose list proc))))
|
||||||
|
(description text)))))
|
||||||
|
|
||||||
(define %default-imported-modules
|
(define %default-imported-modules
|
||||||
;; Default set of modules imported for a service's consumption.
|
;; Default set of modules imported for a service's consumption.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
||||||
;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
|
;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
|
||||||
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
|
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
|
||||||
|
@ -212,7 +212,9 @@ the given target.")
|
||||||
;; 'user-processes' doesn't depend on us. The 'user-file-systems'
|
;; 'user-processes' doesn't depend on us. The 'user-file-systems'
|
||||||
;; service will unmount TARGET eventually.
|
;; service will unmount TARGET eventually.
|
||||||
(delete-file-recursively
|
(delete-file-recursively
|
||||||
(string-append target #$%backing-directory))))))))
|
(string-append target #$%backing-directory))))))
|
||||||
|
(description "Make the store copy-on-write, with writes going to \
|
||||||
|
the given target.")))
|
||||||
|
|
||||||
(define (cow-store-service)
|
(define (cow-store-service)
|
||||||
"Return a service that makes the store copy-on-write, such that writes go to
|
"Return a service that makes the store copy-on-write, such that writes go to
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2015 David Thompson <davet@gnu.org>
|
;;; Copyright © 2015 David Thompson <davet@gnu.org>
|
||||||
;;; Copyright © 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2016, 2017, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2019 Arun Isaac <arunisaac@systemreboot.net>
|
;;; Copyright © 2019 Arun Isaac <arunisaac@systemreboot.net>
|
||||||
;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
|
;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
|
||||||
;;; Copyright © 2020 Google LLC
|
;;; Copyright © 2020 Google LLC
|
||||||
|
@ -76,7 +76,10 @@ from OS that are needed on the bare metal and not in a container."
|
||||||
doing anything.")
|
doing anything.")
|
||||||
(provision '(loopback networking))
|
(provision '(loopback networking))
|
||||||
(start #~(const #t))))
|
(start #~(const #t))))
|
||||||
#f))
|
#f
|
||||||
|
(description "Provide loopback and networking without actually doing
|
||||||
|
anything. This service is used by guest systems running in containers, where
|
||||||
|
networking support is provided by the host.")))
|
||||||
|
|
||||||
(define %nscd-container-caches
|
(define %nscd-container-caches
|
||||||
;; Similar to %nscd-default-caches but with smaller cache sizes. This allows
|
;; Similar to %nscd-default-caches but with smaller cache sizes. This allows
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
|
;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
|
||||||
;;; Copyright © 2017, 2018 Mark H Weaver <mhw@netris.org>
|
;;; Copyright © 2017, 2018 Mark H Weaver <mhw@netris.org>
|
||||||
;;;
|
;;;
|
||||||
|
@ -130,7 +130,8 @@ specifications to 'targets'."
|
||||||
(documentation "Map a device node using Linux's device mapper.")
|
(documentation "Map a device node using Linux's device mapper.")
|
||||||
(start #~(lambda () #$(open source targets)))
|
(start #~(lambda () #$(open source targets)))
|
||||||
(stop #~(lambda _ (not #$(close source targets))))
|
(stop #~(lambda _ (not #$(close source targets))))
|
||||||
(respawn? #f))))))
|
(respawn? #f))))
|
||||||
|
(description "Map a device node using Linux's device mapper.")))
|
||||||
|
|
||||||
(define (device-mapping-service mapped-device)
|
(define (device-mapping-service mapped-device)
|
||||||
"Return a service that sets up @var{mapped-device}."
|
"Return a service that sets up @var{mapped-device}."
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# GNU Guix --- Functional package management for GNU
|
# GNU Guix --- Functional package management for GNU
|
||||||
# Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
# Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
|
||||||
# Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
|
# Copyright © 2017 Tobias Geerinckx-Rice <me@tobias.gr>
|
||||||
# Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
|
# Copyright © 2018 Chris Marusich <cmmarusich@gmail.com>
|
||||||
#
|
#
|
||||||
|
@ -204,7 +204,8 @@ cat > "$tmpfile" <<EOF
|
||||||
(shepherd-service
|
(shepherd-service
|
||||||
(provision '(buggy!))
|
(provision '(buggy!))
|
||||||
(requirement '(does-not-exist))
|
(requirement '(does-not-exist))
|
||||||
(start #t)))))
|
(start #t)))
|
||||||
|
(description "Buggy.")))
|
||||||
|
|
||||||
(operating-system
|
(operating-system
|
||||||
$OS_BASE
|
$OS_BASE
|
||||||
|
|
Reference in New Issue