From: Simon South <simon@simonsouth.net>
To: Morgan.J.Smith@outlook.com
Cc: 49601@debbugs.gnu.org
Subject: [bug#49601] [PATCH] services: transmission: Create downloads directory.
Date: Sat, 17 Jul 2021 13:47:07 -0400 [thread overview]
Message-ID: <87v958g7dw.fsf@simonsouth.net> (raw)
In-Reply-To: <87y2a5gnt6.fsf@simonsouth.net> (Simon South's message of "Sat, 17 Jul 2021 07:52:21 -0400")
Simon South <simon@simonsouth.net> writes:
> Let me see if I can duplicate that...
I haven't been able to duplicate whatever issue it was I saw originally.
Likely it had to do with the download directory being placed on a
separate volume and thus matching a mount point already declared in the
operating-system declaration. Probably the system test should be
expanded to check this kind of configuration works but a quick test on
my end shows that at least for existing setups, it is not a problem.
Morgan, just a few pieces of feedback then:
> This fixes a bug where transmission doesn't have permission to create
> it's download directory. This bug occurs when download-dir is
"it's" should be "its" (no apostrophe) here, the possessive form.
> + (,download-dir #o755))
Again, the permissions here should be "#o750".
Finally, I recommend updating the system test (in
gnu/tests/file-sharing.scm) to verify the download directory is created
correctly, now that this functionality has been added. I've included a
patch below that does this for you. To verify this works, apply the
patch and run the test suite with
make check-system TESTS="transmission-daemon"
The Guix manual has more information[0].
Otherwise, looks good to me. Thanks for submitting this patch.
[0] https://guix.gnu.org/en/manual/en/html_node/Running-the-Test-Suite.html
--
Simon South
simon@simonsouth.net
diff --git a/gnu/tests/file-sharing.scm b/gnu/tests/file-sharing.scm
index 9a8ee6a593..d27a206c4f 100644
--- a/gnu/tests/file-sharing.scm
+++ b/gnu/tests/file-sharing.scm
@@ -34,6 +34,8 @@
(define %transmission-daemon-group "transmission")
(define %transmission-daemon-config-dir "/var/lib/transmission-daemon")
+(define %transmission-daemon-download-dir
+ (string-append %transmission-daemon-config-dir "/downloads"))
(define %transmission-daemon-watch-dir
(string-append %transmission-daemon-config-dir "/watch"))
(define %transmission-daemon-incomplete-dir
@@ -110,8 +112,9 @@
#t)
marionette))
- ;; Make sure Transmission Daemon's configuration directory has been
- ;; created with the correct ownership and permissions.
+ ;; Make sure Transmission Daemon's configuration and download
+ ;; directories have been created with the correct ownership and
+ ;; permissions.
(test-assert "configuration directory exists"
(marionette-eval
'(eq? (stat:type (stat #$%transmission-daemon-config-dir))
@@ -132,6 +135,26 @@
#o750)
marionette))
+ (test-assert "download directory exists"
+ (marionette-eval
+ '(eq? (stat:type (stat #$%transmission-daemon-download-dir))
+ 'directory)
+ marionette))
+ (test-assert "download directory has correct ownership"
+ (marionette-eval
+ '(let ((download-dir (stat #$%transmission-daemon-download-dir))
+ (transmission-user (getpwnam #$%transmission-daemon-user)))
+ (and (eqv? (stat:uid download-dir)
+ (passwd:uid transmission-user))
+ (eqv? (stat:gid download-dir)
+ (passwd:gid transmission-user))))
+ marionette))
+ (test-assert "download directory has expected permissions"
+ (marionette-eval
+ '(eqv? (stat:perms (stat #$%transmission-daemon-download-dir))
+ #o750)
+ marionette))
+
;; Make sure the incomplete-downloads and watch directories have been
;; created with the correct ownership and permissions.
(test-assert "incomplete-downloads directory exists"
next prev parent reply other threads:[~2021-07-17 17:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-17 0:28 [bug#49601] [PATCH] services: transmission: Create downloads directory Morgan.J.Smith
2021-07-17 11:52 ` Simon South
2021-07-17 17:47 ` Simon South [this message]
2021-07-19 12:13 ` Efraim Flashner
2021-07-21 13:14 ` Simon South
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=87v958g7dw.fsf@simonsouth.net \
--to=simon@simonsouth.net \
--cc=49601@debbugs.gnu.org \
--cc=Morgan.J.Smith@outlook.com \
/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.