Skip to content
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: fix startup directory creation #81104

Merged
merged 1 commit into from May 22, 2020

Conversation

bb2020
Copy link
Member

@bb2020 bb2020 commented Feb 26, 2020

Fixes #76552 #78113 #55161. Supplements #70542.

Motivation for this change
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@chreekat
Copy link
Contributor

chreekat commented Mar 1, 2020

@bb2020 , is this still a draft? Are there changes you want to make?

@bb2020
Copy link
Member Author

bb2020 commented Mar 1, 2020

No, this is final. I didn't have time to test it so left it as draft.

@bb2020 bb2020 force-pushed the transmission branch 2 times, most recently from c78d4ef to e06e32c Compare March 1, 2020 14:41
@bb2020 bb2020 marked this pull request as ready for review March 1, 2020 15:36
@chreekat
Copy link
Contributor

chreekat commented Mar 1, 2020

I tested on my computer. I have to admit I'm not sure if it's good enough for multi-user setup or not, but it at least solves my problem!

:/var/lib/transmission]$ ls -al
total 24
drwxrwx---  6 transmission transmission 4096 Mar  1 17:55 .
drwxr-xr-x 29 root         root         4096 Feb 23 14:25 ..
drwxrwxr-x  3 transmission transmission 4096 Feb 23 14:25 .config
drwx------  5 transmission transmission 4096 Mar  1 17:55 config
drwxrwx---  4 transmission transmission 4096 Mar  1 12:50 Downloads
drwxrwx---  2 transmission transmission 4096 Mar  1 12:50 .incomplete

I can get to my downloads now. :)

Run on the following system:

  • system: "x86_64-linux"
  • host os: Linux 5.4.21, NixOS, 20.03beta358.4f8bc8e10bf (Markhor)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.3.2
  • channels(root): "nixos-20.03beta358.4f8bc8e10bf"
  • channels(b): "unstable-20.03pre200231.7827d3f4497"
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

@bb2020
Copy link
Member Author

bb2020 commented Mar 1, 2020

Great. This PR is a go then.

@Lassulus Lassulus merged commit 79f41b2 into NixOS:master May 22, 2020
@anderslundstedt
Copy link
Contributor

After switching to unstable (from 20.03) I get the following error, which I believe is caused by this change.

Jul 16 00:24:29 monster vds9x2b7c6msbm5fqwsr2w3c86xcllig-transmission-pre-start[8217]: + cp -f /nix/store/cyqf105jqpjwp1944fbghzbk4qimkr2s-settings.json /data/downloads/transmission/config/settings.json
Jul 16 00:24:29 monster vds9x2b7c6msbm5fqwsr2w3c86xcllig-transmission-pre-start[8218]: cp: cannot create regular file '/data/downloads/transmission/config/settings.json': No such file or directory
Jul 16 00:24:29 monster systemd[1]: transmission.service: Control process exited, code=exited, status=1/FAILURE
Jul 16 00:24:29 monster systemd[1]: transmission.service: Failed with result 'exit-code'.
Jul 16 00:24:29 monster systemd[1]: Failed to start Transmission BitTorrent Service.

I have services.transmission.enable = true; and services.transmission.home = "/data/downloads/transmission"; The directory /data/downloads/transmission is created with the correct permissions but is empty.

If I unset services.transmission.home everything works.

@anderslundstedt
Copy link
Contributor

After switching to unstable (from 20.03) I get the following error, which I believe is caused by this change.

Indeed, after reverting this commit, transmission works again.

@bb2020
Copy link
Member Author

bb2020 commented Jul 16, 2020

You can temporarily leave home directory as it is and set transmission.settings.download-dir like the following snippet.

services.transmission.enable = true;
services.transmission.settings = {
download-dir = "/data/downloads/transmission";
incomplete-dir-enabled = false;
};

@anderslundstedt
Copy link
Contributor

Thanks! This works to my satisfaction.

@bb2020
Copy link
Member Author

bb2020 commented Jul 17, 2020

Also disable incomplete-files to have partial files in your download directory (updated example).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants