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/prosody: add dataDir option #38643

Merged
merged 1 commit into from Apr 10, 2018
Merged

Conversation

brainrake
Copy link
Contributor

Motivation for this change

It is useful to store mutable state for services in a non-default path, for backup and space allocation purposes. The prosody service did not have a configurable data storage directory.

Things done

Added services.prososdy.dataDir nixos configuration option, made all paths in the prosody module relative to it.

  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • 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 nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@Mic92
Copy link
Member

Mic92 commented Apr 10, 2018

@GrahamcOfBorg test prosody

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: tests.prosody

Partial log (click to expand)

machine: exit status 1
syncing
machine: running command: sync
machine: exit status 0
test script finished in 80.04s
cleaning up
killing machine (pid 593)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/3p2lxq9ng7a096slypqdray3fms7czj9-vm-test-run-prosody

@Mic92 Mic92 merged commit d8647f9 into NixOS:master Apr 10, 2018
@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: tests.prosody

Partial log (click to expand)

machine: exit status 1
syncing
machine: running command: sync
machine: exit status 0
test script finished in 96.08s
cleaning up
killing machine (pid 627)
vde_switch: EOF on stdin, cleaning up and exiting
vde_switch: Could not remove ctl dir '/build/vde1.ctl': Directory not empty
/nix/store/iql5gqh1ving1sb3pj15ln2n8kxvs0kf-vm-test-run-prosody

@ghost ghost mentioned this pull request Apr 11, 2018
8 tasks
@ghost
Copy link

ghost commented Apr 11, 2018

Doesn't work for me
systemd[1]: prosody.service: Permission denied while opening PID file or unsafe symlink chain: /home/gnidorah/xmpp/prosody.pid

@brainrake
Copy link
Contributor Author

brainrake commented Apr 12, 2018

@gnidorah the parent directory of dataDir needs to be created and have permissions (eg. o+rx if the owner and group is root) for the prosody user to be able to access it. Good point, /var/run might be a better location for the PIDfile. I'll fix the PID file location.

@brainrake brainrake deleted the prosody-add-dataDir branch April 12, 2018 07:25
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

3 participants