From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oOoxEeStQGLrDQEAgWs5BA (envelope-from ) for ; Sun, 27 Mar 2022 20:33:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id GIRaCeStQGInZgAAG6o9tA (envelope-from ) for ; Sun, 27 Mar 2022 20:33:08 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C83C91686F for ; Sun, 27 Mar 2022 20:33:07 +0200 (CEST) Received: from localhost ([::1]:54618 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nYXhK-0008VS-IW for larch@yhetil.org; Sun, 27 Mar 2022 14:33:06 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50660) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nYXhH-0008VJ-4p for guix-patches@gnu.org; Sun, 27 Mar 2022 14:33:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34395) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nYXhG-0003xh-K0 for guix-patches@gnu.org; Sun, 27 Mar 2022 14:33:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nYXhG-0008Da-36 for guix-patches@gnu.org; Sun, 27 Mar 2022 14:33:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54561] [PATCH 1/4] services: Add samba service. Resent-From: Simon Streit Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 27 Mar 2022 18:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54561 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 54561@debbugs.gnu.org, fesoj000 Received: via spool by 54561-submit@debbugs.gnu.org id=B54561.164840594231538 (code B ref 54561); Sun, 27 Mar 2022 18:33:02 +0000 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 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1648405987; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=5IgruSvIs0lReZ0tbHz+Vg6khv6FZucLVNqVRIo0vwQ=; b=ExThmJZHREpmqCq9/seML4ch/r0G+WFkM3ypSimFwlAx3QGgvKUm+hemqs3X03qAjFnf0c j471G4x8LFIINzCCrfq/UjEtOkx5VF2JhHBh4wdNVxIbKwmkqENWodEAgFM0/NOvUL31qX 9dkx5HUiTnKsc0v7vNcTwu44dXtU7f+Tdp+QK03yrpj4Rx2lVHf6lFQxITCjJ3/zV4FXDb m3a/ITYo8yFcZTNNKTrZmOXdsHi0ae7vcfSDNWRXshQ9ZAB2ifYWN6MHGv/F56xzhXXkWf 9PlFIF+yzcR4zGOlK2z2MgTimiAVZbcpbfdpQeOITsIbT2ZCNO4UVtEJ4/AOkQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1648405987; a=rsa-sha256; cv=none; b=aRSy2AcKOq5xQX/DSJFjlYWmsND4J0pX2qaoHtFsppdaAXp89ZFMoYSIRPGjtfnuCBncOx xZvo1Eut4h9Dn0UC28je2wdbhIvoR++VRpWyJTSGHuOfaPf6AeZmIx7/tN5pU82zbuo8vU tC8UK2h9FkInPMQssXarhDHh7ETiGR1bfl9coDX9jv4iJVIR28GI/6nGboGpsFwJ8qfXmz plzdFgryiz7MPivZkJuU2V8v1tnW1hL7So1FpbNy2eGGdsdqeI1jTyfKSc2T4Pk2juqDw8 F89w0HIJvPGQzkvAdbEhLXurJzlcX3mzIawtPaOM019KsYe9YOTtW0WW1JRkiA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.07 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: C83C91686F X-Spam-Score: -3.07 X-Migadu-Scanner: scn1.migadu.com X-TUID: PB+nxkYCJ/y+ 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