guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#54561] [PATCH 1/4] services: Add samba service.


From: fesoj000
Subject: [bug#54561] [PATCH 1/4] services: Add samba service.
Date: Sun, 27 Mar 2022 03:07:33 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0

I have a local service definition for samba i wanted to upstream
at some point. Your service looks better then mine though.

+(define (samba-activation config)
+  (let ((package (samba-configuration-package config))
+        (config-file (samba-configuration-config-file config)))
+    (with-imported-modules '((guix build utils))
+      (let ((lib-directory "/var/lib/samba")
+            (log-directory "/var/log/samba")
+            (run-directory "/var/run/samba")
+            (smb.conf "/etc/samba/smb.conf"))
+        #~(begin
+            (use-modules (guix build utils))
+
+            (mkdir-p #$log-directory)
+            (mkdir-p #$run-directory)
+            (mkdir-p (string-append #$lib-directory "/private"))
+            (mkdir-p "/etc/samba")
+            (copy-file #$config-file #$smb.conf)
+            (system* (string-append #$package "/bin/testparm")
+                     "--suppress-prompt" #$smb.conf))))))
Is it a good idea to create all those directories with the default
umask? I always wanted to investigate which of those directories
contains sensitive data. I never got around to.

Another thing i wanted to investigate: can samba and friends be run
as non-root users? I think it would be a good idea to do that if
possible.

fyi: I currently use samba as an AD DC.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]