services: Provide a 'loopback' service by default.

* gnu/services/networking.scm (static-networking-service): Add
  #:provision parameter; use it.
* gnu/services/base.scm (%base-services): Call
  'static-networking-service' for "lo".
This commit is contained in:
Ludovic Courtès 2014-07-12 22:46:44 +02:00
parent f111b327a9
commit 4a3b3b073a
2 changed files with 5 additions and 1 deletions

View File

@ -20,6 +20,7 @@
#:use-module ((guix store) #:use-module ((guix store)
#:select (%store-prefix)) #:select (%store-prefix))
#:use-module (gnu services) #:use-module (gnu services)
#:use-module (gnu services networking)
#:use-module (gnu system shadow) ; 'user-account', etc. #:use-module (gnu system shadow) ; 'user-account', etc.
#:use-module (gnu system linux) ; 'pam-service', etc. #:use-module (gnu system linux) ; 'pam-service', etc.
#:use-module (gnu packages admin) #:use-module (gnu packages admin)
@ -461,6 +462,8 @@ This is the GNU operating system, welcome!\n\n")))
(mingetty-service "tty4" #:motd motd) (mingetty-service "tty4" #:motd motd)
(mingetty-service "tty5" #:motd motd) (mingetty-service "tty5" #:motd motd)
(mingetty-service "tty6" #:motd motd) (mingetty-service "tty6" #:motd motd)
(static-networking-service "lo" "127.0.0.1"
#:provision '(loopback))
(syslog-service) (syslog-service)
(guix-service) (guix-service)
(nscd-service) (nscd-service)

View File

@ -33,6 +33,7 @@
(define* (static-networking-service interface ip (define* (static-networking-service interface ip
#:key #:key
gateway gateway
(provision '(networking))
(name-servers '()) (name-servers '())
(inetutils inetutils) (inetutils inetutils)
(net-tools net-tools)) (net-tools net-tools))
@ -49,7 +50,7 @@ gateway."
(documentation (documentation
(string-append "Set up networking on the '" interface (string-append "Set up networking on the '" interface
"' interface using a static IP address.")) "' interface using a static IP address."))
(provision '(networking)) (provision provision)
(start #~(lambda _ (start #~(lambda _
;; Return #t if successfully started. ;; Return #t if successfully started.
(and (zero? (system* (string-append #$inetutils (and (zero? (system* (string-append #$inetutils