From: Jacob Adams <jacob@tookmund.com>
To: 50808@debbugs.gnu.org
Cc: Jacob Adams <jacob@tookmund.com>
Subject: [bug#50808] [PATCH v2] services: rsync: support binding rsync to a specific IP address
Date: Sun, 26 Sep 2021 13:31:31 -0400 [thread overview]
Message-ID: <20210926173131.3687-1-jacob@tookmund.com> (raw)
In-Reply-To: <20210926030511.17476-1-jacob@tookmund.com>
* gnu/services/rsync.scm: Support IP address configuration
* doc/guix.texi: Document new address rsync configuration option
---
That's a much cleaner approach, thanks! I'm very new to Scheme and
didn't even realize I could do that.
doc/guix.texi | 4 ++++
gnu/services/rsync.scm | 5 ++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 4bf14014eb..a932dbcc09 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -17151,6 +17151,10 @@ Data type representing the configuration for @code{rsync-service}.
@item @code{package} (default: @var{rsync})
@code{rsync} package to use.
+@item @code{address} (default: @code{#f})
+IP address on which @command{rsync} listens for incoming connections.
+If unspecified, it defaults to listening on all available addresses.
+
@item @code{port-number} (default: @code{873})
TCP port on which @command{rsync} listens for incoming connections. If port
is less than @code{1024} @command{rsync} needs to be started as the
diff --git a/gnu/services/rsync.scm b/gnu/services/rsync.scm
index 6c117bbda4..59faed78f6 100644
--- a/gnu/services/rsync.scm
+++ b/gnu/services/rsync.scm
@@ -45,6 +45,8 @@
rsync-configuration?
(package rsync-configuration-package ; package
(default rsync))
+ (address rsync-configuration-address ; string | #f
+ (default #f))
(port-number rsync-configuration-port-number ; integer
(default 873))
(pid-file rsync-configuration-pid-file ; string
@@ -110,7 +112,7 @@
(define rsync-config-file
;; Return the rsync configuration file corresponding to CONFIG.
(match-lambda
- (($ <rsync-configuration> package port-number pid-file lock-file log-file
+ (($ <rsync-configuration> package address port-number pid-file lock-file log-file
use-chroot? share-path share-comment read-only?
timeout user group uid gid)
(if (not (string=? user "root"))
@@ -132,6 +134,7 @@
"pid file = " pid-file "\n"
"lock file = " lock-file "\n"
"log file = " log-file "\n"
+ (if address (string-append "address = " address "\n") "")
"port = " (number->string port-number) "\n"
"use chroot = " (if use-chroot? "true" "false") "\n"
(if uid (string-append "uid = " uid "\n") "")
--
2.30.2
next prev parent reply other threads:[~2021-09-26 17:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-26 3:05 [bug#50808] Jacob Adams
2021-09-26 3:05 ` [bug#50808] [PATCH] services: rsync: support binding rsync to a specific IP address Jacob Adams
2021-09-26 15:24 ` Oleg Pykhalov
2021-09-26 3:13 ` [bug#50808] Fixup bug title Jacob Adams
2021-09-26 17:31 ` Jacob Adams [this message]
2021-10-25 12:09 ` bug#50808: [PATCH] services: rsync: support binding rsync to a specific IP address Ludovic Courtès
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210926173131.3687-1-jacob@tookmund.com \
--to=jacob@tookmund.com \
--cc=50808@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 external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.