summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrice Waegeneire <brice@waegenei.re>2020-06-04 16:14:01 +0200
committerBrice Waegeneire <brice@waegenei.re>2021-05-31 22:06:54 +0200
commitea55e1355bb3d45d5f04e7cb390d2c6afa8e68e6 (patch)
treef085278c08571f543627c62a6bfbad1fd2e7aeb3
parent62a8d487d61513d214b9aa72e7efaefde215cd9b (diff)
downloadguix-ea55e1355bb3d45d5f04e7cb390d2c6afa8e68e6.tar.gz
services: dnsmasq: Extend 'activation-service'.
* gnu/services/dns.scm (dnsmasq-activation): New procedure …
(dnsmasq-service-type): … use it.
-rw-r--r--gnu/services/dns.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/gnu/services/dns.scm b/gnu/services/dns.scm
index 55211cb08f..aeb2bfdc86 100644
--- a/gnu/services/dns.scm
+++ b/gnu/services/dns.scm
@@ -861,12 +861,20 @@ cache.size = 100 * MB
                 #:pid-file "/run/dnsmasq.pid"))
       (stop #~(make-kill-destructor))))))
 
+(define (dnsmasq-activation config)
+  #~(begin
+      (use-modules (guix build utils))
+      ;; create directory to store dnsmasq lease file
+      (mkdir-p "/var/lib/misc")))
+
 (define dnsmasq-service-type
   (service-type
    (name 'dnsmasq)
    (extensions
     (list (service-extension shepherd-root-service-type
-                             (compose list dnsmasq-shepherd-service))))
+                             (compose list dnsmasq-shepherd-service))
+          (service-extension activation-service-type
+                             dnsmasq-activation)))
    (default-value (dnsmasq-configuration))
    (description "Run the dnsmasq DNS server.")))