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

Fix mattermost systemd unit #22899

Merged
merged 2 commits into from Feb 20, 2017
Merged

Fix mattermost systemd unit #22899

merged 2 commits into from Feb 20, 2017

Conversation

arianvp
Copy link
Member

@arianvp arianvp commented Feb 17, 2017

Fixes #22860

Motivation for this change

The preStart hook of the service file tries to set up a postgres database using the psql command.
psql connects to Postgres through a unix domain socket that is in /tmp . However, because we have PrivateTmp=true , psql can never find this domain socket. Hence the change

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • 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.

@mention-bot
Copy link

@arianvp, thanks for your PR! By analyzing the history of the files in this pull request, we identified @fpletz and @abuibrahim to be potential reviewers.

@fpletz fpletz self-assigned this Feb 17, 2017
Copy link
Member

@fpletz fpletz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a better solution would be to keep PrivateTmp enabled and either use -h localhost if cfg.localDatabaseCreate is enabled in the preStart hook. Or maybe try JoinsNamespaceOf with the postgresql service.

@Mic92
Copy link
Member

Mic92 commented Feb 17, 2017

JoinsNamespaceOf sound appropriate to me.

@arianvp
Copy link
Member Author

arianvp commented Feb 17, 2017

That is not possible. -h needs a password to authenticate instead of the current user id that runs the command. JoinsNamespaceOf seems like a better solution. let me try this.

@fpletz fpletz merged commit 252fbbf into NixOS:master Feb 20, 2017
@fpletz
Copy link
Member

fpletz commented Feb 20, 2017

Thanks!

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.

Mattermost module does not create postgres database anymore
5 participants