From patchwork Fri Mar 25 09:00:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Streit X-Patchwork-Id: 38052 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A8BFA27BBEA; Fri, 25 Mar 2022 11:51:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id E656727BBE9 for ; Fri, 25 Mar 2022 11:51:27 +0000 (GMT) Received: from localhost ([::1]:43740 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXiTV-0005zq-UX for patchwork@mira.cbaines.net; Fri, 25 Mar 2022 07:51:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXfog-0000yF-2N for guix-patches@gnu.org; Fri, 25 Mar 2022 05:01:13 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56193) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nXfoc-0000eH-3G for guix-patches@gnu.org; Fri, 25 Mar 2022 05:01:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nXfob-0000dm-OC for guix-patches@gnu.org; Fri, 25 Mar 2022 05:01:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54561] [PATCH 1/4] services: Add samba service. References: In-Reply-To: Resent-From: Simon Streit Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 25 Mar 2022 09:01:01 +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: 54561@debbugs.gnu.org Received: via spool by 54561-submit@debbugs.gnu.org id=B54561.16481988312418 (code B ref 54561); Fri, 25 Mar 2022 09:01:01 +0000 Received: (at 54561) by debbugs.gnu.org; 25 Mar 2022 09:00:31 +0000 Received: from localhost ([127.0.0.1]:50090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXfo6-0000cv-RO for submit@debbugs.gnu.org; Fri, 25 Mar 2022 05:00:31 -0400 Received: from smtprelay04.ispgateway.de ([80.67.18.16]:40613) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXfo5-0000cn-8r for 54561@debbugs.gnu.org; Fri, 25 Mar 2022 05:00:30 -0400 Received: from [93.195.170.97] (helo=milk) by smtprelay04.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nXfoF-0005RL-F5 for 54561@debbugs.gnu.org; Fri, 25 Mar 2022 10:00:39 +0100 From: Simon Streit Gcc: nnfolder+archive:sent.2022-03 Date: Fri, 25 Mar 2022 10:00:26 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Df-Sender: bGlzdHNAbmV0cGFuaWMub3Jn X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Fri, 25 Mar 2022 07:49:33 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/services/samba.scm (): New record. (samba-service-type): New variable. (samba-shepherd-services): New Procedure. --- gnu/services/samba.scm | 173 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 gnu/services/samba.scm -- 2.34.0 diff --git a/gnu/services/samba.scm b/gnu/services/samba.scm new file mode 100644 index 0000000000..ffbf20fdbc --- /dev/null +++ b/gnu/services/samba.scm @@ -0,0 +1,173 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Simon Streit +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu services samba) + + #:use-module (gnu packages) + #:use-module (gnu packages base) + #:use-module (gnu packages admin) + #:use-module (gnu packages samba) + + #:use-module (gnu services) + #:use-module (gnu services configuration) + #:use-module (gnu services shepherd) + #:use-module (gnu services base) + #:use-module (gnu system shadow) + + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix modules) + #:use-module (guix records) + + #:use-module (ice-9 format) + #:use-module (ice-9 match) + #:use-module (ice-9 textual-ports) + #:use-module (srfi srfi-1) + + #:export (samba-service-type + samba-configuration + samba-smb-conf + + wsdd-service-type + wsdd-configuration)) + +(define %smb-conf + (plain-file "smb.conf" "[global] + workgroup = WORKGROUP + server string = Samba Server + server role = standalone server + log file = /var/log/samba/log.%m + logging = file +")) + +(define-record-type* + samba-configuration + make-samba-configuration + samba-configuration? + (package samba-configuration-package + (default samba)) + (config-file samba-configuration-config-file + (default #f)) + (enable-samba? samba-configuration-enable-samba? + (default #f)) + (enable-smbd? samba-configuration-enable-smbd? + (default #t)) + (enable-nmbd? samba-configuration-enable-nmbd? + (default #t)) + (enable-winbindd? samba-configuration-enable-winbindd? + (default #t))) + +(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)))))) + +(define (samba-samba-shepherd-service config) + (let ((package (samba-configuration-package config)) + (config-file (samba-configuration-config-file config))) + (list (shepherd-service + (documentation "Run Samba") + (provision '(samba-samba)) + (requirement '(networking)) + (start #~(make-forkexec-constructor + (list #$(file-append package "/sbin/samba") + (string-append "--configfile=" #$config-file) + "--foreground" + "--no-process-group"))) + (stop #~(make-kill-destructor)))))) + +(define (samba-nmbd-shepherd-service config) + (let ((package (samba-configuration-package config)) + (config-file (samba-configuration-config-file config))) + (list (shepherd-service + (documentation "Run NMBD") + (provision '(samba-nmbd)) + (requirement '(networking)) + (start #~(make-forkexec-constructor + (list #$(file-append package "/sbin/nmbd") + (string-append "--configfile=" #$config-file) + "--foreground" + "--no-process-group"))) + (stop #~(make-kill-destructor)))))) + +(define (samba-smbd-shepherd-service config) + (let ((package (samba-configuration-package config)) + (config-file (samba-configuration-config-file config))) + (list (shepherd-service + (documentation "Run SMBD") + (provision '(samba-smbd)) + (requirement '(networking)) + (start #~(make-forkexec-constructor + (list #$(file-append package "/sbin/smbd") + (string-append "--configfile=" #$config-file) + "--foreground" + "--no-process-group"))) + (stop #~(make-kill-destructor)))))) + +(define (samba-winbindd-shepherd-service config) + (let ((package (samba-configuration-package config)) + (config-file (samba-configuration-config-file config))) + (list (shepherd-service + (documentation "Run Winnbindd for Name Service Switch") + (provision '(samba-winbindd)) + (requirement '(networking)) + (start #~(make-forkexec-constructor + (list #$(file-append package "/sbin/winbindd") + (string-append "--configfile=" #$config-file) + "--foreground" + "--no-process-group"))) + (stop #~(make-kill-destructor)))))) + +(define (samba-shepherd-services config) + (append (if (samba-configuration-enable-samba? config) + (samba-samba-shepherd-service config) + '()) + (if (samba-configuration-enable-nmbd? config) + (samba-nmbd-shepherd-service config) + '()) + (if (samba-configuration-enable-smbd? config) + (samba-smbd-shepherd-service config) + '()) + (if (samba-configuration-enable-winbindd? config) + (samba-winbindd-shepherd-service config) + '()))) + +(define samba-service-type + (service-type + (name 'samba) + (description "Samba") + (extensions + (list (service-extension shepherd-root-service-type + samba-shepherd-services) + (service-extension activation-service-type + samba-activation))) + (default-value (samba-configuration)))) From patchwork Fri Mar 25 09:01:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Streit X-Patchwork-Id: 38054 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id A970B27BBEA; Fri, 25 Mar 2022 11:52:57 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 671D727BBE9 for ; Fri, 25 Mar 2022 11:52:57 +0000 (GMT) Received: from localhost ([::1]:46940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXiUy-0008Ef-J1 for patchwork@mira.cbaines.net; Fri, 25 Mar 2022 07:52:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40264) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXfpa-0001XP-NM for guix-patches@gnu.org; Fri, 25 Mar 2022 05:02:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56197) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nXfpa-0000jd-EH for guix-patches@gnu.org; Fri, 25 Mar 2022 05:02:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nXfpa-0000fR-CN for guix-patches@gnu.org; Fri, 25 Mar 2022 05:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54561] [PATCH 2/4] doc: Add "Samba" chapter. References: In-Reply-To: Resent-From: Simon Streit Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 25 Mar 2022 09:02: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: 54561@debbugs.gnu.org Received: via spool by 54561-submit@debbugs.gnu.org id=B54561.16481989152551 (code B ref 54561); Fri, 25 Mar 2022 09:02:02 +0000 Received: (at 54561) by debbugs.gnu.org; 25 Mar 2022 09:01:55 +0000 Received: from localhost ([127.0.0.1]:50094 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXfpS-0000f5-Hj for submit@debbugs.gnu.org; Fri, 25 Mar 2022 05:01:54 -0400 Received: from smtprelay03.ispgateway.de ([80.67.31.26]:44828) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXfpQ-0000ev-CB for 54561@debbugs.gnu.org; Fri, 25 Mar 2022 05:01:53 -0400 Received: from [93.195.170.97] (helo=milk) by smtprelay03.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nXfpR-0001pv-Ga; Fri, 25 Mar 2022 10:01:53 +0100 From: Simon Streit Gcc: nnfolder+archive:sent.2022-03 Date: Fri, 25 Mar 2022 10:01:50 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Df-Sender: bGlzdHNAbmV0cGFuaWMub3Jn X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Fri, 25 Mar 2022 07:49:33 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches --- doc/guix.texi | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index e8ef4286be..270f07d068 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -101,6 +101,7 @@ Copyright @copyright{} 2021 Andrew Tropin@* Copyright @copyright{} 2021 Sarah Morgensen@* Copyright @copyright{} 2021 Josselin Poiret@* Copyright @copyright{} 2022 Remco van 't Veer@* +Copyright @copyright{} 2022 Simon Streit@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -368,6 +369,7 @@ Services * DNS Services:: DNS daemons. * VPN Services:: VPN daemons. * Network File System:: NFS related services. +* Samba Services:: Samba services. * Continuous Integration:: Cuirass and Laminar services. * Power Management Services:: Extending battery life. * Audio Services:: The MPD. @@ -29861,6 +29863,57 @@ The verbosity level of the daemon. @end table @end deftp +@node Samba Services, Continuous Integration, Network File System, Services +@subsection Samba Services + +@cindex samba +@cindex smb +The @code{(gnu services samba)} module provides Guix service definitions +for Samba as well as additional helper services. Currently it provides +the following services: + +@subsubheading Samba + +Samba provides network shares for folder and printers, it can also be an +AD DC for other samba hosts in an heterougenious network with different +types of Computer systems. + +@defvar{samba-service-type} + +The service type to enable the samba services @code{samba}, @code{nmbd}, +@code{smbd} and @code{winbindd}. By default this service type does not +run as an AD DC, hence @code{samba} remains disabled. It is recommended +that Samba's package is added to the system profile to have the tool-set +available for modifications in Samba's runtime directories. + +@end defvar + +@deftp{Data Type} samba-service-configuration +Configuration record for the Samba suite. + +@table @asis +@item @code{package} (default: @code{samba}) +The samba package to use. + +@item @code{config-file} (default: @code{#f}) +The config file to use. Please note: Setting this variable will disable +all config options that come after @code{enable-winbindd?}. + +@item @code{enable-samba?} (default: @code{#f}) +Manually enable the @code{samba} daemon. + +@item @code{enable-smbd?} (default: @code{#f}) +Manually enable the @code{smbd} daemon. + +@item @code{enable-nmbd?} (default: @code{#f}) +Manually enable the @code{nmbd} daemon. + +@item @code{enable-winbindd?} (default: @code{#f}) +Manually enable the @code{winbindd} daemon. + +@end table +@end deftp + @node Continuous Integration @subsection Continuous Integration From patchwork Thu Mar 24 21:10:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Streit X-Patchwork-Id: 38051 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E628327BBEB; Fri, 25 Mar 2022 11:50:11 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 6297827BBEA for ; Fri, 25 Mar 2022 11:50:11 +0000 (GMT) Received: from localhost ([::1]:42352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXiSI-000529-Fl for patchwork@mira.cbaines.net; Fri, 25 Mar 2022 07:50:10 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40466) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXfqY-0002hR-FA for guix-patches@gnu.org; Fri, 25 Mar 2022 05:03:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56201) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nXfqY-0000qD-6w for guix-patches@gnu.org; Fri, 25 Mar 2022 05:03:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nXfqY-0000h3-06 for guix-patches@gnu.org; Fri, 25 Mar 2022 05:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54561] [PATCH 3/4] doc: Add documentation for WSDD service. References: In-Reply-To: Resent-From: Simon Streit Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 25 Mar 2022 09:03:01 +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: 54561@debbugs.gnu.org Received: via spool by 54561-submit@debbugs.gnu.org id=B54561.16481989762652 (code B ref 54561); Fri, 25 Mar 2022 09:03:01 +0000 Received: (at 54561) by debbugs.gnu.org; 25 Mar 2022 09:02:56 +0000 Received: from localhost ([127.0.0.1]:50098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXfqR-0000gh-Vr for submit@debbugs.gnu.org; Fri, 25 Mar 2022 05:02:56 -0400 Received: from smtprelay04.ispgateway.de ([80.67.31.32]:15569) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXfqQ-0000ga-I4 for 54561@debbugs.gnu.org; Fri, 25 Mar 2022 05:02:55 -0400 Received: from [93.195.170.97] (helo=milk) by smtprelay04.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nXfqb-0007RG-Ky; Fri, 25 Mar 2022 10:03:05 +0100 From: Simon Streit Date: Thu, 24 Mar 2022 22:10:05 +0100 Gcc: nnfolder+archive:sent.2022-03 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Df-Sender: bGlzdHNAbmV0cGFuaWMub3Jn X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Fri, 25 Mar 2022 07:49:33 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches --- doc/guix.texi | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/doc/guix.texi b/doc/guix.texi index 270f07d068..9770856050 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -29914,6 +29914,72 @@ Manually enable the @code{winbindd} daemon. @end table @end deftp +@cindex wsdd +@subsubheading Web Service Discovery Daemon + +Web Service Discovery Daemon implements the WSD protocoll. It is a +drop-in replacement for host discovery that lack support for the SMBv1 +protocol. + +@defvr{Scheme Variable} wsdd-service-type + +Service type for the Web Service Discoery host daemon. The value for +this service type is a @code{wsdd-configuration} record. The details +for the @code{wsdd-configuration} record type are given below. +@end defvr + +@deftp{Data Type} wsdd-configuration This data type represents the +configuration for the wsdd service. + +@table @asis + +@item @code{package} (default: @code{wsdd}) +The wsdd package to use. + +@item @code{ipv4only?} (default: @code{#f}) +Only listen to ipv4 addresses. + +@item @code{ipv6only} (default: @code{#f}) +Only listen to ipv6 addresses. Please note: Activating both options is +not possible, since there would be no ip versions to listen to. + +@item @code{chroot} (default: @code{#f}) +Chroot into a sperate directory to prevent access to other directories. +This is to increase security in case there is a vulnerability in +@command{wsdd}. + +@item @code{hoplimit} (default: @code{1}) +Limit to the level of hops for multicast packets. The default is +@var{1} which should prevent packets from leaving the local network. + +@item @code{interface} (default: @code{'()}) +Limit to the given list of interfaces to listen to. By default wsdd +will listen to all interfaces. Except the loopback interface is never +used. + +@item @code{uuid-device} (default: @code{#f}) +The WSD protocol requires a device to have a UUID. Set this to manually +assign the service a UUID. + +@item @code{domain} (default: @code{#f}) +Notify this host is a member of an Active Directory. + +@item @code{hostname} (default: @code{#f}) +Manually set the hostname rather than letting @command{wsdd} inherit +this host's hostname. + +@item @code{preserve-case?} (default: @code{#f}) +By default @command{wsdd} will convert the hostname in workgroup to all +uppercase. The opposite is true for hostnames in domains. Setting this +parameter will preserve case. + +@item @code{workgroup} (default: @var{"WORKGROUP"}) +Change the name of the workgroup. By default @command{wsdd} reports +this host being member of a workgroup. + +@end table +@end deftp + @node Continuous Integration @subsection Continuous Integration From patchwork Thu Mar 24 21:14:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Streit X-Patchwork-Id: 38055 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id C2A3B27BBEA; Fri, 25 Mar 2022 11:53:05 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7013827BBE9 for ; Fri, 25 Mar 2022 11:53:05 +0000 (GMT) Received: from localhost ([::1]:47356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nXiV6-0008Vk-Jl for patchwork@mira.cbaines.net; Fri, 25 Mar 2022 07:53:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nXfrX-0002v2-19 for guix-patches@gnu.org; Fri, 25 Mar 2022 05:04:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56205) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nXfrW-0000u3-GI for guix-patches@gnu.org; Fri, 25 Mar 2022 05:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nXfrW-0000il-AP for guix-patches@gnu.org; Fri, 25 Mar 2022 05:04:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54561] [PATCH 4/4] services: Add wsdd service. References: In-Reply-To: Resent-From: Simon Streit Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 25 Mar 2022 09:04: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: 54561@debbugs.gnu.org Received: via spool by 54561-submit@debbugs.gnu.org id=B54561.16481990212738 (code B ref 54561); Fri, 25 Mar 2022 09:04:02 +0000 Received: (at 54561) by debbugs.gnu.org; 25 Mar 2022 09:03:41 +0000 Received: from localhost ([127.0.0.1]:50102 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXfrB-0000i6-Ah for submit@debbugs.gnu.org; Fri, 25 Mar 2022 05:03:41 -0400 Received: from smtprelay07.ispgateway.de ([134.119.228.101]:51461) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nXfr9-0000hy-SM for 54561@debbugs.gnu.org; Fri, 25 Mar 2022 05:03:40 -0400 Received: from [93.195.170.97] (helo=milk) by smtprelay07.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nXfr9-0001ii-8P; Fri, 25 Mar 2022 10:03:39 +0100 From: Simon Streit Date: Thu, 24 Mar 2022 22:14:05 +0100 Gcc: nnfolder+archive:sent.2022-03 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Df-Sender: bGlzdHNAbmV0cGFuaWMub3Jn X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Fri, 25 Mar 2022 07:49:33 -0400 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/services/samba.scm (): New record. (wsdd-service-type): New variable. (wsdd-shepherd-services): New procedure. --- gnu/services/samba.scm | 107 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) diff --git a/gnu/services/samba.scm b/gnu/services/samba.scm index ffbf20fdbc..3058ed9d47 100644 --- a/gnu/services/samba.scm +++ b/gnu/services/samba.scm @@ -171,3 +171,110 @@ (define samba-service-type (service-extension activation-service-type samba-activation))) (default-value (samba-configuration)))) + + +;;; +;;; WSDD +;;; + +(define-record-type* + wsdd-configuration + make-wsdd-configuration + wsdd-configuration? + (package wsdd-configuration-package + (default wsdd)) + (ipv4only? wsdd-configuration-ipv4only? + (default #f)) + (ipv6only? wsdd-configuration-ipv6only? + (default #f)) + (chroot wsdd-configuration-chroot + (default #f)) + (hoplimit wsdd-configuration-hoplimit + (default 1)) + (interfaces wsdd-configuration-interfaces + (default '())) + (uuid-device wsdd-configuration-uuid-device + (default #f)) + (domain wsdd-configuration-domain + (default #f)) + (hostname wsdd-configuration-hostname + (default #f)) + (preserve-case? wsdd-configuration-preserve-case? + (default #f)) + (workgroup wsdd-configuration-workgroup + (default "WORKGROUP"))) + +(define wsdd-accounts + (list + (user-group (name "wsdd")) + (user-account (name "wsdd") + (group "wsdd") + (comment "Web Service Discovery user") + (home-directory "/var/empty") + (shell (file-append shadow "/sbin/nologin"))))) + +(define wsdd-shepherd-service + (match-lambda + (($ package + ipv4only? + ipv6only? + chroot + hoplimit + interfaces + uuid-device + domain + hostname + preserve-case? + workgroup + ) + (list (shepherd-service + (documentation "Run a Web Service Discovery service") + (provision '(wsdd)) + (requirement '(networking)) + (start #~(make-forkexec-constructor + (list #$(file-append package "/bin/wsdd") + #$@(if ipv4only? + #~("--ipv4only") + '()) + #$@(if ipv6only? + #~("--ipv6only") + '()) + #$@(if chroot + #~("--chroot" #$chroot) + '()) + #$@(if hoplimit + #~("--hoplimit" #$(number->string hoplimit)) + '()) + #$@(map (lambda (interfaces) + (string-append "--interface=" interfaces)) + interfaces) + #$@(if uuid-device + #~("--uuid" #$uuid-device) + '()) + #$@(if domain + #~("--domain" #$domain) + '()) + #$@(if hostname + #~("--hostname" #$hostname) + '()) + #$@(if preserve-case? + #~("--preserve-case") + '()) + #$@(if workgroup + #~("--workgroup" #$workgroup) + '())) + #:user "wsdd" + #:group "wsdd" + #:log-file "/var/log/wsdd.log")) + (stop #~(make-kill-destructor))))))) + +(define wsdd-service-type + (service-type + (name 'wsdd) + (description "Web Service Discovery Daemon") + (extensions + (list (service-extension shepherd-root-service-type + wsdd-shepherd-service) + (service-extension account-service-type + (const wsdd-accounts)))) + (default-value (wsdd-configuration))))