nixos/services/crowdsec: update systemd service unit config

This commit is contained in:
Gabriel Arazas 2024-09-22 18:05:05 +08:00
parent 77dec408cd
commit b02896bf15
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360

View File

@ -213,11 +213,20 @@ in
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
serviceConfig = { serviceConfig = {
ExecReload = "kill -HUP $MAINPID";
ReadWritePaths = ReadWritePaths =
lib.optionals (cfg.settings.common.log_media or "" == "file") [ lib.optionals (cfg.settings.common.log_media or "" == "file") [
cfg.settings.common.log_folder cfg.settings.common.log_folder
]; ];
User = "crowdsec";
Group = "crowdsec";
# TODO: Ideally, this should be set conditionally.
# To enable access to systemd journal files.
SupplementaryGroups = [ "systemd-journal" ];
DynamicUser = true;
Type = "notify"; Type = "notify";
Restart = "always"; Restart = "always";
RestartSec = "60"; RestartSec = "60";
@ -237,7 +246,7 @@ in
RemoveIPC = true; RemoveIPC = true;
StandardOutput = "journal"; StandardOutput = "journal";
StandardError = "journal"; StandardError = "journal";
SystemCallFilter = "@system-service"; SystemCallFilter = [ "@system-service" ];
SystemCallErrorNumber = "EPERM"; SystemCallErrorNumber = "EPERM";
RestrictAddressFamilies = [ RestrictAddressFamilies = [