aboutsummaryrefslogtreecommitdiff
path: root/gnu/services/networking.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-09-30 12:01:32 +0200
committerLudovic Courtès <ludo@gnu.org>2016-09-30 12:05:27 +0200
commit79355ae3e84359716f5135cc7083e72246bc8bf9 (patch)
tree6b61851e2153581578bb78ef0f177b8841ee5db7 /gnu/services/networking.scm
parent39d6b9c99f297e14fc4f47f002be3d40556726be (diff)
parent86d8f6d3efb8300a3354735cbf06be6c01e23243 (diff)
downloadguix-79355ae3e84359716f5135cc7083e72246bc8bf9.tar
guix-79355ae3e84359716f5135cc7083e72246bc8bf9.tar.gz
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/services/networking.scm')
-rw-r--r--gnu/services/networking.scm27
1 files changed, 21 insertions, 6 deletions
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 71f49a03a5..7495179f8e 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -2,6 +2,7 @@
;;; Copyright © 2013, 2014, 2015, 2016 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016 John Darrington <jmd@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -193,7 +194,7 @@ gateway."
'dhcp-client
(lambda (dhcp)
(define dhclient
- #~(string-append #$dhcp "/sbin/dhclient"))
+ (file-append dhcp "/sbin/dhclient"))
(define pid-file
"/var/run/dhclient.pid")
@@ -272,7 +273,7 @@ Protocol (DHCP) client, on all the non-loopback network interfaces."
(let ()
;; TODO: Add authentication support.
(define config
- (string-append "driftfile /var/run/ntp.drift\n"
+ (string-append "driftfile /var/run/ntpd/ntp.drift\n"
(string-join (map (cut string-append "server " <>)
servers)
"\n")
@@ -305,7 +306,19 @@ restrict -6 ::1\n"))
(system? #t)
(comment "NTP daemon user")
(home-directory "/var/empty")
- (shell #~(string-append #$shadow "/sbin/nologin")))))
+ (shell (file-append shadow "/sbin/nologin")))))
+
+
+(define (ntp-service-activation config)
+ "Return the activation gexp for CONFIG."
+ (with-imported-modules '((guix build utils))
+ #~(begin
+ (define %user
+ (getpw "ntpd"))
+
+ (let ((directory "/var/run/ntpd"))
+ (mkdir-p directory)
+ (chown directory (passwd:uid %user) (passwd:gid %user))))))
(define ntp-service-type
(service-type (name 'ntp)
@@ -313,7 +326,9 @@ restrict -6 ::1\n"))
(list (service-extension shepherd-root-service-type
ntp-shepherd-service)
(service-extension account-service-type
- (const %ntp-accounts))))))
+ (const %ntp-accounts))
+ (service-extension activation-service-type
+ ntp-service-activation)))))
(define* (ntp-service #:key (ntp ntp)
(servers %ntp-servers))
@@ -346,7 +361,7 @@ keep the system clock synchronized with that of @var{servers}."
(system? #t)
(comment "Tor daemon user")
(home-directory "/var/empty")
- (shell #~(string-append #$shadow "/sbin/nologin")))))
+ (shell (file-append shadow "/sbin/nologin")))))
(define-record-type <hidden-service>
(hidden-service name mapping)
@@ -539,7 +554,7 @@ project's documentation} for more information."
(system? #t)
(comment "BitlBee daemon user")
(home-directory "/var/empty")
- (shell #~(string-append #$shadow "/sbin/nologin")))))
+ (shell (file-append shadow "/sbin/nologin")))))
(define %bitlbee-activation
;; Activation gexp for BitlBee.