From 4774b34ea30d5ca00c5dfa44b2491fe6455eb5a4 Mon Sep 17 00:00:00 2001 From: JEAN-FRANCOIS GUILLAUME Date: Wed, 23 Nov 2022 17:12:10 +0100 Subject: [PATCH 1/3] adding sssd service --- glicid/services/authentication.scm | 92 ++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 glicid/services/authentication.scm diff --git a/glicid/services/authentication.scm b/glicid/services/authentication.scm new file mode 100644 index 0000000..9409e51 --- /dev/null +++ b/glicid/services/authentication.scm @@ -0,0 +1,92 @@ +(define-module (glicid services parallel) + #:use-module (gnu services) + #:use-module (gnu services shepherd) + #:use-module (gnu system shadow) + #:use-module (guix) + #:use-module (guix records) + #:use-module (ice-9 match) + #:use-module (gnu packages sssd) + #:use-module (glicid system file-systems) + #:export ( + sssd-configuration + sssd-configuration? + sssd-service + sssd-service-type + ) +) + +(define-record-type* + sssd-configuration make-sssd-configuration sssd-configuration? + (sssd-pkg sssd-pkg + (default sssd) + ) + (sssd-conf sssd-conf + (default (file-append sssd-pkg "/lib/sssd/conf/sssd.conf")) + ) + (sssd-logger sssd-logger + (default "stderr") + ) + (sssd-debug-level sssd-debug-level + (default "") + ) + (log-file log-file + (default "/var/log/sssd/sssd.log") + ) +) + +(define sssd-service + (match-lambda + (($ sssd-pkg sssd-conf sssd-logger sssd-debug-level log-file) + (list + (shepherd-service + (provision '(sssd) ) + (documentation "Run sssd.") + (requirement '( + user-processes + )) + (respawn? #t) + (start #~(make-forkexec-constructor + (list + #$(file-append sssd-pkg "/sbin/sssd") + "--interactive" + (list (string-append "--config=" sssd-conf)) + (list(string-append "--logger=" sssd-logger)) + #$@(if sssd-debug-level + (list (string-append "--debug-level=" sssd-debug-level)) + '() + ) + ) + #:log-file #$log-file + )) + (stop #~(make-kill-destructor)) + ) + ) + ) + ) +) + +(define %sssd-activation + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + (define (touch file-name) + (call-with-output-file file-name (const #t)) + ) + (mkdir-p "/var/log/sssd") + (mkdir-p "/var/lib/sssd") + #t + ) + ) +) + +(define sssd-service-type + (service-type (name 'sssd) + (extensions + (list + (service-extension shepherd-root-service-type sssd-service) + (service-extension activation-service-type (const %sssd-activation)) + ) + ) + (description "Run sssd") + ) +) From 43e93745016c73fd042f5e594633ddb22a909cb2 Mon Sep 17 00:00:00 2001 From: JEAN-FRANCOIS GUILLAUME Date: Wed, 23 Nov 2022 17:12:55 +0100 Subject: [PATCH 2/3] type on define-module --- glicid/services/authentication.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/glicid/services/authentication.scm b/glicid/services/authentication.scm index 9409e51..23baa3f 100644 --- a/glicid/services/authentication.scm +++ b/glicid/services/authentication.scm @@ -1,7 +1,6 @@ -(define-module (glicid services parallel) +(define-module (glicid services authentication) #:use-module (gnu services) #:use-module (gnu services shepherd) - #:use-module (gnu system shadow) #:use-module (guix) #:use-module (guix records) #:use-module (ice-9 match) From a730d942ea7057c626e19b19f686dc2a367ca99a Mon Sep 17 00:00:00 2001 From: JEAN-FRANCOIS GUILLAUME Date: Wed, 23 Nov 2022 17:37:00 +0100 Subject: [PATCH 3/3] sssd service --- glicid/services/authentication.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glicid/services/authentication.scm b/glicid/services/authentication.scm index 23baa3f..f4d4126 100644 --- a/glicid/services/authentication.scm +++ b/glicid/services/authentication.scm @@ -47,7 +47,7 @@ (start #~(make-forkexec-constructor (list #$(file-append sssd-pkg "/sbin/sssd") - "--interactive" +; "--interactive" (list (string-append "--config=" sssd-conf)) (list(string-append "--logger=" sssd-logger)) #$@(if sssd-debug-level