forked from mirrors/nixpkgs
parent
d23521b16c
commit
8a1e7cd556
|
@ -8,7 +8,7 @@ let
|
||||||
|
|
||||||
mkBindSockets = socks: concatStringsSep "\n" (map (each: " bind_socket = \"${each}\"") socks);
|
mkBindSockets = socks: concatStringsSep "\n" (map (each: " bind_socket = \"${each}\"") socks);
|
||||||
|
|
||||||
rspamdConf =
|
rspamdConfFile = pkgs.writeText "rspamd.conf"
|
||||||
''
|
''
|
||||||
.include "$CONFDIR/common.conf"
|
.include "$CONFDIR/common.conf"
|
||||||
|
|
||||||
|
@ -18,8 +18,7 @@ let
|
||||||
}
|
}
|
||||||
|
|
||||||
logging {
|
logging {
|
||||||
type = "file";
|
type = "syslog";
|
||||||
filename = "$LOGDIR/rspamd.log";
|
|
||||||
.include "$CONFDIR/logging.inc"
|
.include "$CONFDIR/logging.inc"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +32,6 @@ let
|
||||||
.include "$CONFDIR/worker-controller.inc"
|
.include "$CONFDIR/worker-controller.inc"
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
rspamdConfFile = pkgs.writeText "rspamd.conf" rspamdConf;
|
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
|
@ -58,7 +56,7 @@ in
|
||||||
bindSocket = mkOption {
|
bindSocket = mkOption {
|
||||||
type = types.listOf types.str;
|
type = types.listOf types.str;
|
||||||
default = [
|
default = [
|
||||||
"/run/rspamd.sock mode=0666 owner=${cfg.user}"
|
"/run/rspamd/rspamd.sock mode=0666 owner=${cfg.user}"
|
||||||
];
|
];
|
||||||
description = ''
|
description = ''
|
||||||
List of sockets to listen, in format acceptable by rspamd
|
List of sockets to listen, in format acceptable by rspamd
|
||||||
|
@ -128,13 +126,13 @@ in
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.rspamd}/bin/rspamd ${optionalString cfg.debug "-d"} --user=${cfg.user} --group=${cfg.group} --pid=/run/rspamd.pid -c ${rspamdConfFile} -f";
|
ExecStart = "${pkgs.rspamd}/bin/rspamd ${optionalString cfg.debug "-d"} --user=${cfg.user} --group=${cfg.group} --pid=/run/rspamd.pid -c ${rspamdConfFile} -f";
|
||||||
RuntimeDirectory = "/var/lib/rspamd";
|
|
||||||
PermissionsStartOnly = true;
|
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
|
RuntimeDirectory = "rspamd";
|
||||||
|
PrivateTmp = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
preStart = ''
|
preStart = ''
|
||||||
${pkgs.coreutils}/bin/mkdir -p /var/{lib,log}/rspamd
|
${pkgs.coreutils}/bin/mkdir -p /var/lib/rspamd
|
||||||
${pkgs.coreutils}/bin/chown ${cfg.user}:${cfg.group} /var/lib/rspamd
|
${pkgs.coreutils}/bin/chown ${cfg.user}:${cfg.group} /var/lib/rspamd
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue