From 850adcf4b17afb6f5429b030f3c814d502d2b53e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Mon, 7 Sep 2020 08:39:35 +0200 Subject: Put services in slices in systemd --- modules/private/databases/redis.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'modules/private/databases') diff --git a/modules/private/databases/redis.nix b/modules/private/databases/redis.nix index 4602510..bc6460f 100644 --- a/modules/private/databases/redis.nix +++ b/modules/private/databases/redis.nix @@ -41,6 +41,7 @@ in { maxclients 1024 ''; }; + systemd.services.redis.serviceConfig.Slice = "redis.slice"; services.spiped = { enable = true; @@ -57,8 +58,9 @@ in { wantedBy = [ "multi-user.target" ]; serviceConfig = { - Restart = "always"; - User = "spiped"; + Slice = "redis.slice"; + Restart = "always"; + User = "spiped"; PermissionsStartOnly = true; SupplementaryGroups = "keys"; }; @@ -108,12 +110,17 @@ in { } ]; + systemd.slices.redis = { + description = "Redis slice"; + }; + systemd.services.predixy = { description = "Redis proxy"; wantedBy = [ "multi-user.target" ]; after = [ "redis.service" ]; serviceConfig = { + Slice = "redis.slice"; User = "redis"; Group = "redis"; SupplementaryGroups = "keys"; -- cgit v1.2.3