nixos/ejabberd: use standalone epmd service
There can only be one epmd per machine, and ejabberd will spawn it in its context if it is not running. This is fine if ejabberd is the only Erlang application running on the machine, but it will cause problems when coexisting with others. Specifically when services.epmd is enabled at the same time, this will cause a port collision if epmd.socket starts up after ejabberd.service. Make sure that doesn't happen by depending on services.epmd.
This commit is contained in:
@@ -93,6 +93,8 @@ in
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = [ cfg.package ];
|
||||
|
||||
services.epmd.enable = true;
|
||||
|
||||
users.users = lib.optionalAttrs (cfg.user == "ejabberd") {
|
||||
ejabberd = {
|
||||
group = cfg.group;
|
||||
@@ -109,7 +111,11 @@ in
|
||||
systemd.services.ejabberd = {
|
||||
description = "ejabberd server";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
after = [
|
||||
"network.target"
|
||||
"epmd.socket"
|
||||
];
|
||||
wants = [ "epmd.socket" ];
|
||||
path = [
|
||||
pkgs.findutils
|
||||
pkgs.coreutils
|
||||
|
||||
Reference in New Issue
Block a user