From debbugs-submit-bounces@debbugs.gnu.org Sun Mar 27 14:32:22 2022 Received: (at 54561) by debbugs.gnu.org; 27 Mar 2022 18:32:22 +0000 Received: from localhost ([127.0.0.1]:56525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYXgb-0008Cc-QD for submit@debbugs.gnu.org; Sun, 27 Mar 2022 14:32:22 -0400 Received: from smtprelay04.ispgateway.de ([80.67.31.38]:24679) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nYXgZ-0008CS-BG for 54561@debbugs.gnu.org; Sun, 27 Mar 2022 14:32:20 -0400 Received: from [91.40.247.147] (helo=motorball) by smtprelay04.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nYXgm-0006K9-M8; Sun, 27 Mar 2022 20:32:32 +0200 From: Simon Streit To: Maxime Devos Subject: Re: [bug#54561] [PATCH 1/4] services: Add samba service. References: <2f1eb553-2d1d-2e83-1412-948011d502cc@gmail.com> <02c2e04f0ef7404aab26e2c590cf3cd44634c74d.camel@telenet.be> Gcc: nnfolder+archive:sent.2022-03 Date: Sun, 27 Mar 2022 20:32:16 +0200 In-Reply-To: <02c2e04f0ef7404aab26e2c590cf3cd44634c74d.camel@telenet.be> (Maxime Devos's message of "Sun, 27 Mar 2022 16:13:46 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Df-Sender: bGlzdHNAbmV0cGFuaWMub3Jn X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 54561 Cc: 54561@debbugs.gnu.org, fesoj000 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Maxime Devos writes: > fesoj000 schreef op zo 27-03-2022 om 03:07 [+0200]: >> > +(define (samba-activation config) >> > +=C2=A0 (let ((package (samba-configuration-package config)) >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (config-file (samba-config= uration-config-file config))) >> > +=C2=A0=C2=A0=C2=A0 (with-imported-modules '((guix build utils)) >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (let ((lib-directory "/var/lib/samba") >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (l= og-directory "/var/log/samba") >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (r= un-directory "/var/run/samba") >> > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (s= mb.conf "/etc/samba/smb.conf")) > > Is it necessary to put the configuration file there? > Can be we do something like (system* "/.../testparm" #$smb.conf), where > smb.conf is the generated configuration file? No, not really. The Samba suit has a lot of tools that may want to look into the default config directory. It seems that any relevant configuration belonging to Samba lands in smb.conf, that is looked into anytime when needed. That is my impression, and thus placed it there. >> 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. I'm not so sure myself. That was the end result of what had to be created to have the service successfully initiate itself. True that I have not investigated this myself yet. While writing this service I was comparing the directory structure with Debian and Arch Linux, to be sure that it would work.=20 > > FWIW, you can use 'mkdir-p/perms' to set the permission bits. > The (string-append ...) can be simplified to: > > (system* #$(file-append package "/bin/testparm" "--suppres-prompt > #$smb.conf). > > Also, would it be a good idea to use (invoke ...) instead of system, to > make sure errors are detected? What is the 'suppress-prompt' for? My understanding now would be better to write invoke. Thanks for pointing this out.=20=20