mirror of
https://gitlab.univ-nantes.fr/glicid-public/guix-glicid.git
synced 2025-05-02 15:13:04 +02:00
bump bind version and adding service
This commit is contained in:
parent
3bc00474e9
commit
bb8c8fa014
2 changed files with 114 additions and 0 deletions
55
glicid/services/dns.scm
Normal file
55
glicid/services/dns.scm
Normal file
|
@ -0,0 +1,55 @@
|
|||
(define-module (glicid services dns)
|
||||
#:use-module (gnu packages dns)
|
||||
#:use-module (gnu services)
|
||||
#:use-module (gnu services shepherd)
|
||||
#:use-module (guix)
|
||||
#:use-module (guix records)
|
||||
#:use-module (ice-9 match)
|
||||
#: export (
|
||||
named-configuration
|
||||
named-configuration?
|
||||
named-shepherd-service
|
||||
named-service-type
|
||||
))
|
||||
|
||||
(define-record-type*
|
||||
<named-configuration>
|
||||
named-configuration make-named-configuration
|
||||
named-configuration?
|
||||
(named-pkg named-pkg (default isc-bind))
|
||||
(config-file config-file (default (file-append named "/etc/named/named.conf")))
|
||||
(pid-file pid-file (default "/var/run/named.pid"))
|
||||
(log-file log-file (default "/var/log/named.log")))
|
||||
|
||||
(define named-shepherd-service
|
||||
(match-lambda
|
||||
(($ <named-configuration> named-pkg config-file pid-file log-file )
|
||||
(list
|
||||
(shepherd-service
|
||||
(provision '(named))
|
||||
(documentation "Run named.")
|
||||
(requirement '(user-processes))
|
||||
(respawn? #t)
|
||||
(start #~(make-forkexec-constructor
|
||||
(list
|
||||
#$(file-append named-pkg "/sbin/named")
|
||||
"-f"
|
||||
"-c" #$config-file
|
||||
)
|
||||
#:pid-file #$pid-file
|
||||
#:log-file #$log-file ))
|
||||
(stop #~(make-kill-destructor)))))))
|
||||
|
||||
(define %named-activation
|
||||
#~(begin
|
||||
(mkdir-p "/var/run/named")
|
||||
(mkdir-p "/var/lib/named")
|
||||
#t ))
|
||||
|
||||
(define named-service-type
|
||||
(service-type
|
||||
(name 'named)
|
||||
(extensions (list
|
||||
(service-extension shepherd-root-service-type named-shepherd-service)
|
||||
(service-extension activation-service-type (const %named-activation))))
|
||||
(description "Run named.")))
|
Loading…
Add table
Add a link
Reference in a new issue