@@ -8,7 +8,7 @@ let
88
99 mkBindSockets = socks: concatStringsSep "\n" (map (each: " bind_socket = \"${each}\"") socks);
1010
11− rspamdConf =
11+ rspamdConfFile = pkgs.writeText "rspamd.conf"
1212 ''
1313 .include "$CONFDIR/common.conf"
1414
@@ -18,8 +18,7 @@ let
1818 }
1919
2020 logging {
21− type = "file";
22− filename = "$LOGDIR/rspamd.log";
21+ type = "syslog";
2322 .include "$CONFDIR/logging.inc"
2423 }
2524
@@ -33,7 +32,6 @@ let
3332 .include "$CONFDIR/worker-controller.inc"
3433 }
3534 '';
36− rspamdConfFile = pkgs.writeText "rspamd.conf" rspamdConf;
3735
3836in
3937
@@ -58,7 +56,7 @@ in
5856 bindSocket = mkOption {
5957 type = types.listOf types.str;
6058 default = [
61− "/run/rspamd.sock mode=0666 owner=${cfg.user}"
59+ "/run/rspamd/rspamd.sock mode=0666 owner=${cfg.user}"
6260 ];
6361 description = ''
6462 List of sockets to listen, in format acceptable by rspamd
@@ -128,13 +126,13 @@ in
128126
129127 serviceConfig = {
130128 ExecStart = "${pkgs.rspamd}/bin/rspamd ${optionalString cfg.debug "-d"} --user=${cfg.user} --group=${cfg.group} --pid=/run/rspamd.pid -c ${rspamdConfFile} -f";
131− RuntimeDirectory = "/var/lib/rspamd";
132− PermissionsStartOnly = true;
133129 Restart = "always";
130+ RuntimeDirectory = "rspamd";
131+ PrivateTmp = true;
134132 };
135133
136134 preStart = ''
137− ${pkgs.coreutils}/bin/mkdir -p /var/{lib,log}/rspamd
135+ ${pkgs.coreutils}/bin/mkdir -p /var/lib/rspamd
138136 ${pkgs.coreutils}/bin/chown ${cfg.user}:${cfg.group} /var/lib/rspamd
139137 '';
140138