unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Simon Streit <simon@netpanic.org>
To: 54561@debbugs.gnu.org
Cc: Simon Streit <simon@netpanic.org>
Subject: [bug#54561] v2 [PATCH 4/5] services: Add wsdd service.
Date: Fri,  8 Apr 2022 20:21:30 +0200	[thread overview]
Message-ID: <20220408182131.10271-5-simon@netpanic.org> (raw)
In-Reply-To: <20220408182131.10271-1-simon@netpanic.org>

* gnu/services/samba.scm (<wsdd-configuration>): 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))))
+
+\f
+;;;
+;;; WSDD
+;;;
+
+(define-record-type* <wsdd-configuration>
+  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
+    (($ <wsdd-configuration> 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





  parent reply	other threads:[~2022-04-08 18:23 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25  8:48 [bug#54561] [PATCH 0/4] Add service declarations for Samba Simon Streit
2022-03-24 21:10 ` [bug#54561] [PATCH 3/4] doc: Add documentation for WSDD service Simon Streit
2022-03-24 21:14 ` [bug#54561] [PATCH 4/4] services: Add wsdd service Simon Streit
2022-03-25  9:16   ` Simon Streit
2022-03-25 12:02     ` Simon Streit
2022-03-25  9:00 ` [bug#54561] [PATCH 1/4] services: Add samba service Simon Streit
2022-03-27  1:07   ` fesoj000
2022-03-27 14:13     ` Maxime Devos
2022-03-27 18:32       ` Simon Streit
2022-04-08 18:21       ` [bug#54561] v2 [PATCH 0/5] Add service declarations for Samba Simon Streit
2022-04-08 18:21         ` [bug#54561] v2 [PATCH 1/5] services: Add samba service Simon Streit
2022-04-08 21:26           ` [bug#54561] [PATCH 0/4] Add service declarations for Samba Ludovic Courtès
2022-04-08 18:21         ` [bug#54561] v2 [PATCH 2/5] doc: Add "Samba" chapter Simon Streit
2022-04-08 21:35           ` [bug#54561] [PATCH 0/4] Add service declarations for Samba Ludovic Courtès
2022-04-08 18:21         ` [bug#54561] v2 [PATCH 3/5] doc: Add documentation for WSDD service Simon Streit
2022-04-08 21:41           ` [bug#54561] [PATCH 0/4] Add service declarations for Samba Ludovic Courtès
2022-04-09  8:29           ` [bug#54561] v2 [PATCH 3/5] doc: Add documentation for WSDD service Maxime Devos
2022-04-08 18:21         ` Simon Streit [this message]
2022-04-08 21:43           ` [bug#54561] [PATCH 0/4] Add service declarations for Samba Ludovic Courtès
2022-04-08 18:21         ` [bug#54561] v2 [PATCH 5/5] gnu: Add wsdd Simon Streit
2022-04-08 21:23         ` [bug#54561] [PATCH 0/4] Add service declarations for Samba Ludovic Courtès
2022-03-27 18:48     ` [bug#54561] [PATCH 1/4] services: Add samba service Simon Streit
2022-03-27 18:58       ` fesoj000
2022-03-25  9:01 ` [bug#54561] [PATCH 2/4] doc: Add "Samba" chapter Simon Streit
2022-03-27  1:07   ` fesoj000
2022-03-27 14:15   ` Maxime Devos
2022-03-27 18:51     ` Simon Streit
2022-03-25 15:14 ` [bug#54561] [PATCH] gnu: samba: Modify input list Simon Streit
2022-03-27 19:22 ` [bug#54561] [PATCH] gnu: libdaemon: fix build for riscv64 fesoj000
2022-03-27 19:23   ` fesoj000
2022-08-08 14:56 ` [bug#54561] [PATCH v3 0/4] Add samba and wsdd to services list simon
2022-08-08 14:56   ` [bug#54561] [PATCH v3 1/4] gnu: samba: Add avahi to inputs simon
2022-08-08 14:56   ` [bug#54561] [PATCH v3 2/4] services: Add samba service simon
2022-08-08 14:56   ` [bug#54561] [PATCH v3 3/4] gnu: Add wsdd simon
2022-08-08 14:56   ` [bug#54561] [PATCH v3 4/4] services: Add wsdd service simon
2022-09-24  7:48   ` bug#54561: [PATCH v3 0/4] Add samba and wsdd to services list Lars-Dominik Braun
2022-09-25  8:22     ` [bug#54561] " Lars-Dominik Braun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220408182131.10271-5-simon@netpanic.org \
    --to=simon@netpanic.org \
    --cc=54561@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).