aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-10-18 00:45:05 +0200
committerLudovic Courtès <ludo@gnu.org>2018-10-18 01:12:22 +0200
commit39d7fdce453b0ca23ecbed72048647debbaa58a6 (patch)
tree1fb6244895e071c1e2e559a19818e1c02b412f5c
parent03fd37b4eb9ec7600c9292361177ca5a47814cf7 (diff)
downloadguix-39d7fdce453b0ca23ecbed72048647debbaa58a6.tar
guix-39d7fdce453b0ca23ecbed72048647debbaa58a6.tar.gz
services: dhcp-client: Deprecate 'dhcp-client-service' procedure.
* gnu/services/networking.scm (dhcp-client-service-type): Add default value. * gnu/system/examples/bare-bones.tmpl: Use (service dhcp-client-service-type) instead of (dhcp-client-service). * gnu/system/examples/beaglebone-black.tmpl: Likewise. * gnu/tests/base.scm (%avahi-os): Likewise. * gnu/tests/databases.scm (%memcached-os): Likewise. (%mongodb-os): Likewise. * gnu/tests/dict.scm (%dicod-os): Likewise. * gnu/tests/mail.scm (%opensmtpd-os): Likewise. (%exim-os): Likewise. (%dovecot-os): Likewise. * gnu/tests/messaging.scm (run-xmpp-test): Likewise. (run-bitlbee-test): Likewise. * gnu/tests/monitoring.scm (%prometheus-node-exporter-os): Likewise. * gnu/tests/networking.scm (%inetd-os): Likewise. (run-iptables-test): Likewise. * gnu/tests/nfs.scm (%base-os): Likewise. * gnu/tests/rsync.scm (%rsync-os): Likewise. * gnu/tests/ssh.scm (run-ssh-test): Likewise. * gnu/tests/version-control.scm (%cgit-os): Likewise. (%git-http-os): Likewise. (%gitolite-os): Likewise. * gnu/tests/virtualization.scm (%libvirt-os): Likewise. * gnu/tests/web.scm (%httpd-os): Likewise. (%nginx-os): Likewise. (%varnish-os): Likewise. (%php-fpm-os): Likewise. (%hpcguix-web-os): Likewise. (%tailon-os): Likewise. * tests/guix-system.sh: Likewise. * doc/guix.texi (Networking Services): Document 'dhcp-client-service-type' and remove 'dhcp-client-service'.
-rw-r--r--doc/guix.texi11
-rw-r--r--gnu/services/networking.scm6
-rw-r--r--gnu/system/examples/bare-bones.tmpl2
-rw-r--r--gnu/system/examples/beaglebone-black.tmpl2
-rw-r--r--gnu/tests/base.scm2
-rw-r--r--gnu/tests/databases.scm4
-rw-r--r--gnu/tests/dict.scm2
-rw-r--r--gnu/tests/mail.scm6
-rw-r--r--gnu/tests/messaging.scm4
-rw-r--r--gnu/tests/monitoring.scm2
-rw-r--r--gnu/tests/networking.scm4
-rw-r--r--gnu/tests/nfs.scm2
-rw-r--r--gnu/tests/rsync.scm2
-rw-r--r--gnu/tests/ssh.scm2
-rw-r--r--gnu/tests/version-control.scm6
-rw-r--r--gnu/tests/virtualization.scm2
-rw-r--r--gnu/tests/web.scm12
-rw-r--r--guix/gexp.scm8
-rw-r--r--tests/guix-system.sh4
19 files changed, 47 insertions, 36 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index fde7892cfd..f4f19949f1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -11546,10 +11546,11 @@ The @code{(gnu services networking)} module provides services to configure
the network interface.
@cindex DHCP, networking service
-@deffn {Scheme Procedure} dhcp-client-service [#:dhcp @var{isc-dhcp}]
-Return a service that runs @var{dhcp}, a Dynamic Host Configuration
-Protocol (DHCP) client, on all the non-loopback network interfaces.
-@end deffn
+@defvr {Scheme Variable} dhcp-client-service-type
+This is the type of services that run @var{dhcp}, a Dynamic Host Configuration
+Protocol (DHCP) client, on all the non-loopback network interfaces. Its value
+is the DHCP client package to use, @code{isc-dhcp} by default.
+@end defvr
@deffn {Scheme Procedure} dhcpd-service-type
This type defines a service that runs a DHCP daemon. To create a
@@ -17168,7 +17169,7 @@ A helper function to quickly add php to an @code{nginx-server-configuration}.
A simple services setup for nginx with php can look like this:
@example
-(services (cons* (dhcp-client-service)
+(services (cons* (service dhcp-client-service-type)
(service php-fpm-service-type)
(service nginx-service-type
(nginx-server-configuration
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index c809b4a4a4..61a0e975c7 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -53,6 +53,7 @@
static-networking-service-type)
#:export (%facebook-host-aliases
dhcp-client-service
+ dhcp-client-service-type
dhcpd-service-type
dhcpd-configuration
@@ -202,9 +203,10 @@ fe80::1%lo0 apps.facebook.com\n")
"-pf" #$pid-file ifaces))))
(and (zero? (cdr (waitpid pid)))
(read-pid-file #$pid-file)))))
- (stop #~(make-kill-destructor))))))
+ (stop #~(make-kill-destructor))))
+ isc-dhcp))
-(define* (dhcp-client-service #:key (dhcp isc-dhcp))
+(define* (dhcp-client-service #:key (dhcp isc-dhcp)) ;deprecated
"Return a service that runs @var{dhcp}, a Dynamic Host Configuration
Protocol (DHCP) client, on all the non-loopback network interfaces."
(service dhcp-client-service-type dhcp))
diff --git a/gnu/system/examples/bare-bones.tmpl b/gnu/system/examples/bare-bones.tmpl
index b763258e52..889dcabe64 100644
--- a/gnu/system/examples/bare-bones.tmpl
+++ b/gnu/system/examples/bare-bones.tmpl
@@ -44,7 +44,7 @@
;; Add services to the baseline: a DHCP client and
;; an SSH server.
- (services (cons* (dhcp-client-service)
+ (services (cons* (service dhcp-client-service-type)
(service openssh-service-type
(openssh-configuration
(port-number 2222)))
diff --git a/gnu/system/examples/beaglebone-black.tmpl b/gnu/system/examples/beaglebone-black.tmpl
index d1130c76b6..efef682e3a 100644
--- a/gnu/system/examples/beaglebone-black.tmpl
+++ b/gnu/system/examples/beaglebone-black.tmpl
@@ -45,7 +45,7 @@
;; Globally-installed packages.
(packages (cons* screen openssh %base-packages))
- (services (cons* (dhcp-client-service)
+ (services (cons* (service dhcp-client-service-type)
;; mingetty does not work on serial lines.
;; Use agetty with board-specific serial parameters.
(agetty-service
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index f97581de33..896d4a8f88 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -673,7 +673,7 @@ non-ASCII names from /tmp.")
(name-service-switch %mdns-host-lookup-nss)
(services (cons* (avahi-service #:debug? #t)
(dbus-service)
- (dhcp-client-service) ;needed for multicast
+ (service dhcp-client-service-type) ;needed for multicast
;; Enable heavyweight debugging output.
(modify-services (operating-system-user-services
diff --git a/gnu/tests/databases.scm b/gnu/tests/databases.scm
index 5c8ca85c13..e0544bbcd2 100644
--- a/gnu/tests/databases.scm
+++ b/gnu/tests/databases.scm
@@ -35,7 +35,7 @@
(define %memcached-os
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(service memcached-service-type)))
(define* (run-memcached-test #:optional (port 11211))
@@ -130,7 +130,7 @@
(operating-system
(inherit
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(service mongodb-service-type)))
(packages (cons* mongodb
%base-packages))))
diff --git a/gnu/tests/dict.scm b/gnu/tests/dict.scm
index dd60ffd464..c50e3cd6da 100644
--- a/gnu/tests/dict.scm
+++ b/gnu/tests/dict.scm
@@ -34,7 +34,7 @@
(define %dicod-os
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(service dicod-service-type
(dicod-configuration
(interfaces '("0.0.0.0"))
diff --git a/gnu/tests/mail.scm b/gnu/tests/mail.scm
index 5677969fac..33aa4d3437 100644
--- a/gnu/tests/mail.scm
+++ b/gnu/tests/mail.scm
@@ -36,7 +36,7 @@
(define %opensmtpd-os
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(service opensmtpd-service-type
(opensmtpd-configuration
(config-file
@@ -155,7 +155,7 @@ accept from any for local deliver to mbox
(define %exim-os
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(service mail-aliases-service-type '())
(service exim-service-type
(exim-configuration
@@ -283,7 +283,7 @@ acl_check_data:
(define %dovecot-os
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(dovecot-service #:config
(dovecot-configuration
(disable-plaintext-auth? #f)
diff --git a/gnu/tests/messaging.scm b/gnu/tests/messaging.scm
index f5f99b9f56..36afb987af 100644
--- a/gnu/tests/messaging.scm
+++ b/gnu/tests/messaging.scm
@@ -35,7 +35,7 @@
"Run a test of an OS running XMPP-SERVICE, which writes its PID to PID-FILE."
(define os
(marionette-operating-system
- (simple-operating-system (dhcp-client-service)
+ (simple-operating-system (service dhcp-client-service-type)
xmpp-service)
#:imported-modules '((gnu services herd))))
@@ -167,7 +167,7 @@
(define (run-bitlbee-test)
(define os
(marionette-operating-system
- (simple-operating-system (dhcp-client-service)
+ (simple-operating-system (service dhcp-client-service-type)
(service bitlbee-service-type
(bitlbee-configuration
(interface "0.0.0.0"))))
diff --git a/gnu/tests/monitoring.scm b/gnu/tests/monitoring.scm
index 67899987ce..3320a19a77 100644
--- a/gnu/tests/monitoring.scm
+++ b/gnu/tests/monitoring.scm
@@ -85,7 +85,7 @@
(define %prometheus-node-exporter-os
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(service prometheus-node-exporter-service-type
(prometheus-node-exporter-configuration))))
diff --git a/gnu/tests/networking.scm b/gnu/tests/networking.scm
index ceba7f7d5d..9f12a4ae8d 100644
--- a/gnu/tests/networking.scm
+++ b/gnu/tests/networking.scm
@@ -39,7 +39,7 @@
(define %inetd-os
;; Operating system with 2 inetd services.
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(service inetd-service-type
(inetd-configuration
(entries (list
@@ -463,7 +463,7 @@ COMMIT
(define os
(marionette-operating-system
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(service inetd-service-type
(inetd-configuration
(entries (list
diff --git a/gnu/tests/nfs.scm b/gnu/tests/nfs.scm
index 140f03779b..7ef9f1f7bf 100644
--- a/gnu/tests/nfs.scm
+++ b/gnu/tests/nfs.scm
@@ -55,7 +55,7 @@
(services (cons*
(service rpcbind-service-type
(rpcbind-configuration))
- (dhcp-client-service)
+ (service dhcp-client-service-type)
%base-services))))
(define (run-nfs-test name socket)
diff --git a/gnu/tests/rsync.scm b/gnu/tests/rsync.scm
index a6f8fa2bd1..096580022f 100644
--- a/gnu/tests/rsync.scm
+++ b/gnu/tests/rsync.scm
@@ -111,7 +111,7 @@ PORT."
;; Return operating system under test.
(let ((base-os
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(service rsync-service-type))))
(operating-system
(inherit base-os)
diff --git a/gnu/tests/ssh.scm b/gnu/tests/ssh.scm
index 2e40122add..e5cd439cdf 100644
--- a/gnu/tests/ssh.scm
+++ b/gnu/tests/ssh.scm
@@ -39,7 +39,7 @@ empty-password logins.
When SFTP? is true, run an SFTP server test."
(define os
(marionette-operating-system
- (simple-operating-system (dhcp-client-service) ssh-service)
+ (simple-operating-system (service dhcp-client-service-type) ssh-service)
#:imported-modules '((gnu services herd)
(guix combinators))))
(define vm
diff --git a/gnu/tests/version-control.scm b/gnu/tests/version-control.scm
index 4409b8a12b..230aa9edf9 100644
--- a/gnu/tests/version-control.scm
+++ b/gnu/tests/version-control.scm
@@ -92,7 +92,7 @@
;; Operating system under test.
(let ((base-os
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(service cgit-service-type
(cgit-configuration
(nginx %cgit-configuration-nginx)))
@@ -237,7 +237,7 @@ HTTP-PORT."
(define %git-http-os
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(service fcgiwrap-service-type)
(service nginx-service-type %git-nginx-configuration)
%test-repository-service))
@@ -328,7 +328,7 @@ HTTP-PORT."
(define %gitolite-os
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(service openssh-service-type)
(service gitolite-service-type
(gitolite-configuration
diff --git a/gnu/tests/virtualization.scm b/gnu/tests/virtualization.scm
index c2939355b2..fbdec20805 100644
--- a/gnu/tests/virtualization.scm
+++ b/gnu/tests/virtualization.scm
@@ -32,7 +32,7 @@
(define %libvirt-os
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(dbus-service)
(polkit-service)
(service libvirt-service-type)))
diff --git a/gnu/tests/web.scm b/gnu/tests/web.scm
index 2e209fee97..319655396a 100644
--- a/gnu/tests/web.scm
+++ b/gnu/tests/web.scm
@@ -125,7 +125,7 @@ HTTP-PORT."
(define %httpd-os
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(service httpd-service-type
(httpd-configuration
(config
@@ -154,7 +154,7 @@ HTTP-PORT."
(define %nginx-os
;; Operating system under test.
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(service nginx-service-type
(nginx-configuration
(log-directory "/var/log/nginx")
@@ -188,7 +188,7 @@ sub vcl_synth {
(define %varnish-os
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
;; Pretend to be a web server that serves %index.html-contents.
(service varnish-service-type
(varnish-configuration
@@ -237,7 +237,7 @@ echo(\"Computed by php:\".((string)(2+3)));
(define %php-fpm-os
;; Operating system under test.
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(service php-fpm-service-type)
(service nginx-service-type
(nginx-configuration
@@ -392,7 +392,7 @@ HTTP-PORT, along with php-fpm."
(define %hpcguix-web-os
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(service hpcguix-web-service-type
(hpcguix-web-configuration
(specs %hpcguix-web-specs)))))
@@ -407,7 +407,7 @@ HTTP-PORT, along with php-fpm."
(define %tailon-os
;; Operating system under test.
(simple-operating-system
- (dhcp-client-service)
+ (service dhcp-client-service-type)
(service tailon-service-type
(tailon-configuration
(config-file
diff --git a/guix/gexp.scm b/guix/gexp.scm
index f7a23db872..ba0d642b17 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -438,6 +438,14 @@ This is the declarative counterpart of 'gexp->file'."
(base file-append-base) ;<package> | <derivation> | ...
(suffix file-append-suffix)) ;list of strings
+(define (write-file-append file port)
+ (match file
+ (($ <file-append> base suffix)
+ (format port "#<file-append ~s ~s>" base
+ (string-join suffix)))))
+
+(set-record-type-printer! <file-append> write-file-append)
+
(define (file-append base . suffix)
"Return a <file-append> object that expands to the concatenation of BASE and
SUFFIX."
diff --git a/tests/guix-system.sh b/tests/guix-system.sh
index a129efdfcb..23d2da4903 100644
--- a/tests/guix-system.sh
+++ b/tests/guix-system.sh
@@ -153,8 +153,8 @@ cat > "$tmpfile" <<EOF
(operating-system
$OS_BASE
- (services (cons* (dhcp-client-service)
- (dhcp-client-service) ;twice!
+ (services (cons* (service dhcp-client-service-type)
+ (service dhcp-client-service-type) ;twice!
%base-services)))
EOF