summaryrefslogtreecommitdiffstats
path: root/tv/3modules/ejabberd/default.nix
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2022-08-22 17:09:53 +0200
committertv <tv@krebsco.de>2022-10-08 23:29:23 +0200
commit3f1a9c5375cd06dea30f3deaa36cae7125fad492 (patch)
treeeb07686729b0aef260a4a2189ee6665e73d83931 /tv/3modules/ejabberd/default.nix
parent876fd5404d0bc9f838119505a4b7a9b7bdb60e9e (diff)
tv ejabberd: sync service with upstream template
Incorporate parts from ejabberd 21.04's ejabberd.service.template
Diffstat (limited to 'tv/3modules/ejabberd/default.nix')
-rw-r--r--tv/3modules/ejabberd/default.nix24
1 files changed, 18 insertions, 6 deletions
diff --git a/tv/3modules/ejabberd/default.nix b/tv/3modules/ejabberd/default.nix
index 147e53d61..15736e189 100644
--- a/tv/3modules/ejabberd/default.nix
+++ b/tv/3modules/ejabberd/default.nix
@@ -82,20 +82,32 @@ in {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
- ExecStart = pkgs.writeDash "ejabberd" ''
- ${pkgs.coreutils}/bin/ln -s "$CREDENTIALS_DIRECTORY" /tmp/credentials
- ${gen-dhparam} ${cfg.stateDir}/dhfile
- exec ${cfg.pkgs.ejabberd}/bin/ejabberdctl foreground
- '';
+ ExecStartPre = [
+ "${pkgs.coreutils}/bin/ln -s \${CREDENTIALS_DIRECTORY} /tmp/credentials"
+ "${gen-dhparam} ${cfg.stateDir}/dhfile"
+ ];
+ ExecStart = "${cfg.pkgs.ejabberd}/bin/ejabberdctl foreground";
+ ExecStop = [
+ "${cfg.pkgs.ejabberd}/bin/ejabberdctl stop"
+ "${cfg.pkgs.ejabberd}/bin/ejabberdctl stopped"
+ ];
+ ExecReload = "${cfg.pkgs.ejabberd}/bin/ejabberdctl reload_config";
LoadCredential = [
"certfile:${cfg.certfile}"
];
+ LimitNOFILE = 65536;
+ PrivateDevices = true;
PrivateTmp = true;
SyslogIdentifier = "ejabberd";
StateDirectory = "ejabberd";
User = "ejabberd";
DynamicUser = true;
- TimeoutStartSec = 60;
+ TimeoutSec = 60;
+ RestartSec = 5;
+ Restart = "on-failure";
+ Type = "notify";
+ NotifyAccess = "all";
+ WatchdogSec = 30;
};
};
};