This commit is contained in:
Jean-François GUILLAUME 2021-12-02 21:30:43 +01:00
parent b9553b913f
commit deb424e698
2 changed files with 17 additions and 9 deletions

View file

@ -20,10 +20,10 @@
(openldap openldap-configuration-openldap ;<package>
(default openldap)
)
(arguments openldap-configuration-arguments ;list of strings
(extra-args openldap-configuration-arguments ;list of strings
(default '())
)
(logflags openldap-configuration-logflags ;number
(log-flags openldap-configuration-logflags ;number
(default "0")
)
(log-file openldap-configuration-log-file ; string
@ -35,17 +35,16 @@
(config-file openldap-configuration-config-file ; string
(default %default-slapd.conf)
)
(schema-dir openldap-configuration-schema-dir ; string
(default '())
)
)
(define %default-slapd.conf
(plain-file "slapd.conf" "
# Empty file for test
"))
(define openldap-shepherd-service
(match-lambda
(($ <openldap-configuration> openldap arguments logflags log-file pid-file config-file schema-dir)
(($ <openldap-configuration> openldap extra-args log-flags log-file pid-file config-file)
(list
(shepherd-service
(provision '(slapd) )
@ -54,12 +53,15 @@
(respawn? #f)
(start #~(make-forkexec-constructor
(list
; We do not set the uri in the service definition because if we do, we need a way to
; escape double quotes. You should use slapd.conf to set the uri
#$(file-append openldap "/libexec/slapd")
"-h 'ldap:/// ldaps:///'"
"-d" #$logflags
"-d" #$log-flags
"-f" #$config-file
#$extra-args
)
#:pid-file #$pid-file
#:log-file #$log-file
))
(stop #~(make-kill-destructor))
)
@ -67,6 +69,7 @@
)
)
)
(define openldap-service-type
(service-type (name 'slapd)
(extensions

View file

@ -23,9 +23,12 @@
(define-record-type* <rc-local-configuration>
rc-local-configuration make-rc-local-configuration
rc-local-configuration?
(config-file rc-local-config-file ; string
(config-file rc-local-config-file
(default %default-rc-local-conf)
)
(log-file rc-local-log-file
(default "/var/log/rc-local.log")
)
)
(define rc-local-service
@ -37,12 +40,14 @@
(documentation "Run rc-local.")
(requirement '(user-processes))
(respawn? #f)
(one-shot? #t)
(start #~(make-forkexec-constructor
(list
#$(file-append bash "/bin/bash")
"-l"
#$config-file
)
#:log-file #$log-file
))
(stop #~(make-kill-destructor))
)