New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/transmission: allow prestart to create directories #42537
Conversation
@GrahamcOfBorg test transmission |
Failure on x86_64-linux (full log) Attempted: tests.transmission Partial log (click to expand)
|
Failure on aarch64-linux (full log) Attempted: tests.transmission Partial log (click to expand)
|
b8b2afd
to
d14511a
Compare
Modified smoke test to use a local copy of the torrent file instead of downloading from Debian's site. The download now fails for some reason; Using a local copy allows the test to run. |
|
It looks the ownership should also be changed and mode should be 770, not 755. If it is not writable by group, then creating the group is purposeless. |
755/drwxr-xr-x is used because when the directories are created the absolute path is specified along with the "-p" option, causing |
Oh, you have a |
Yeah, that's what I just changed. I'm building the test VM now. I'm also adding an if-then block so that the directories are created only if they don't already exist. That way if users have other permissions, or decide to change them after the fact, the script will leave them alone. |
This change executes the systemd transmission daemon pre-start script as root so that it's able to create any directories specified in the configuration. * Directories leading to a directory are created in mode 775 and are owned by root, if those directories are missing (changed). * If the final directory doesn't already exist: * Mode set to 770 (unchanged) * Ownership and group are changed to `transmission` (changed). Note that this does not guarantee that the directories are accessible by transmission. For example, if the `download-dir` is set to `/home/alice/torrents` the pre-start script will be able to create the directory, but because `/home/alice` is owned by user `alice` and the mode is 700, transmission won't be able to access it (since it runs under the user `transmission`). Closes NixOS#41643
This change updates the transmission NixOS test to attempt downloading a torrent. The purpose is to ensure the transmission daemon can access its directories. For example, by default adding a torrent via `transmission-remote` causes the daemon to save the .torrent file to /var/lib/transmission/.config/torrents
d14511a
to
15b232f
Compare
Motivation for this change
This change executes the systemd transmission service pre-start script as
root
so that it's able to create any directories specified in the configuration. In addition,
a smoke-test is added to the existing tests.
Pre-start script
Group is changed totransmission
(changed).transmission
(changed).Ownership is left unchanged; Hence if the directory had to be created the file it will be owned by root.Note that this does not guarantee that the directories are accessible by
transmission. For example, if the
download-dir
is set to/home/alice/torrents
the pre-start script will be able to create the directory, but because
/home/alice
is owned by useralice
and the mode is 700, transmissionwon't be able to access it (since it runs under the user
transmission
).Smoke-test
This change also updates the transmission NixOS test to attempt downloading a torrent.
The purpose is to ensure the transmission daemon can access its directories.
For example, by default adding a torrent via
transmission-remote
causes the daemonto save the .torrent file to /var/lib/transmission/.config/torrents
The download is cancelled right after it's started.
Closes #41643
Things done
sandbox
innix.conf
on non-NixOS)[ ] macOS[ ] other Linux distributionsnix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)The command
nix path-info -S nixos/tests -f transmission.nix
produced:error: path '/nix/store/5fzg0xpyhx82slw7i7d5761bkh9k3s8q-vm-test-run-transmission' is not valid
I don't know how to determine the closure size for this change.