diff --git a/glicid/services/openldap.scm b/glicid/services/openldap.scm index 1b9859f..867b356 100644 --- a/glicid/services/openldap.scm +++ b/glicid/services/openldap.scm @@ -20,10 +20,10 @@ (openldap openldap-configuration-openldap ; (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 arguments logflags log-file pid-file config-file schema-dir) + (($ 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 diff --git a/glicid/services/rc-local.scm b/glicid/services/rc-local.scm index 0e43c6c..01cd700 100644 --- a/glicid/services/rc-local.scm +++ b/glicid/services/rc-local.scm @@ -23,9 +23,12 @@ (define-record-type* 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)) )