From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SJd6N6R9UGKyNgAAgWs5BA (envelope-from ) for ; Fri, 08 Apr 2022 20:23:32 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id QJw/NKR9UGIgTwAAauVa8A (envelope-from ) for ; Fri, 08 Apr 2022 20:23:32 +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 81B233C1C5 for ; Fri, 8 Apr 2022 20:23:32 +0200 (CEST) Received: from localhost ([::1]:34112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nctGd-0007eV-Nw for larch@yhetil.org; Fri, 08 Apr 2022 14:23:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nctGC-00070h-Ah for guix-patches@gnu.org; Fri, 08 Apr 2022 14:23:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:42018) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nctGC-0001iF-1Y for guix-patches@gnu.org; Fri, 08 Apr 2022 14:23:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nctGB-0003ax-U8 for guix-patches@gnu.org; Fri, 08 Apr 2022 14:23:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54561] v2 [PATCH 4/5] services: Add wsdd service. Resent-From: Simon Streit Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 08 Apr 2022 18:23:03 +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 Cc: Simon Streit Received: via spool by 54561-submit@debbugs.gnu.org id=B54561.164944214213717 (code B ref 54561); Fri, 08 Apr 2022 18:23:03 +0000 Received: (at 54561) by debbugs.gnu.org; 8 Apr 2022 18:22:22 +0000 Received: from localhost ([127.0.0.1]:35909 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nctFW-0003ZA-2z for submit@debbugs.gnu.org; Fri, 08 Apr 2022 14:22:22 -0400 Received: from smtprelay05.ispgateway.de ([80.67.31.93]:16579) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nctFT-0003Yo-7G for 54561@debbugs.gnu.org; Fri, 08 Apr 2022 14:22:19 -0400 Received: from [212.202.170.33] (helo=milk.d22.home.arpa) by smtprelay05.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1nctFn-0007s3-SN; Fri, 08 Apr 2022 20:22:40 +0200 From: Simon Streit Date: Fri, 8 Apr 2022 20:21:30 +0200 Message-Id: <20220408182131.10271-5-simon@netpanic.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220408182131.10271-1-simon@netpanic.org> References: <02c2e04f0ef7404aab26e2c590cf3cd44634c74d.camel@telenet.be> <20220408182131.10271-1-simon@netpanic.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Df-Sender: c2ltb25AbmV0cGFuaWMub3Jn 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=1649442212; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: 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=6VQF5xAXhMyxd+3UKOfiHL7N4LTT1dWHbn++z1mfPpY=; b=FNzXWHIy+haEXQzbyjjb472MgivvwfcLo4+4iPUA6Sx7cqcK0rNqNaUJbwB5dwWUBsOBHR KAx89wJXq8U0LzjbQqIp2p5PVAnwYlHfPXGqkwioIx44ULJuYzil4vMsn/xkHybJ8S/GLD zhL9e4JZ8Dfb+x/wFEXIK+EKWyt73QcdPZGEKc6P4xy9b3YysbLqYod1rLcRxwKhrhBp13 T9RrXumwV7tSjSi6/QAvUaCf8kauGsXo5AMvzEPigszujpHrZOwq+XZ9YhbnzfdIRzXJpl 8eH454W2LnJMMteOfS3C8umcr6hjqPAg/BycWuTM0LPg2GKR/x20qKGwaaLMww== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1649442212; a=rsa-sha256; cv=none; b=E0ogWitKrrGgiWxFs/cs1njL+Q5+lu+emB6dAj9519k1fi7c7jV6CtsrlFZ9//Q6ouqGKk FnP+plYRv1pH2LSPETk4FGnygd2tFwh3ZkLn4QTj+wZ30rml+GivY7Vg5bpYitiM6aF9Vu LqtH//FytF8EtviqedDXcw6DYiOxISSXrIPxJWsUfGNElzSaDJpCMbpVw6c6GGgXAXVT5x T7vqodSakJyJ28K9igaMiRtAZofzX3yGNsg+dAz97kCo60uWsWbg6ORPUPedqS8YPEo61o uLNYrKhYD3++w/Gfl91izoqHK9dtF058YFryM6zKpV/Y759KsZ9GZg4EHsyGAQ== 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: -0.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: 81B233C1C5 X-Spam-Score: -0.07 X-Migadu-Scanner: scn1.migadu.com X-TUID: oA+npgNBaa0n * gnu/services/samba.scm (): New record. (wsdd-service-type): New variable. (wsdd-shepherd-services): New procedure. --- gnu/services/samba.scm | 100 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/gnu/services/samba.scm b/gnu/services/samba.scm index 70b07f93fb..d15d916363 100644 --- a/gnu/services/samba.scm +++ b/gnu/services/samba.scm @@ -175,3 +175,103 @@ (define samba-service-type (service-extension profile-service-type (compose list samba-configuration-package)))) (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)) + (service-extension profile-service-type + (compose list wsdd-configuration-package)))) + (default-value (wsdd-configuration)))) -- 2.34.0