fix: service no longer stalling

CPUShares and MemoryLimit are depricated
Sep 05 20:30:42 marvin systemd[1]: /etc/systemd/system/splunk.service:9: Unit uses CPUShares=; please use CPUWeight= instead. Support for CPUShares= will be removed soon.
Sep 05 20:30:42 marvin systemd[1]: /etc/systemd/system/splunk.service:18: Unit uses MemoryLimit=; please use MemoryMax= instead. Support for MemoryLimit= will be removed soon.
This commit is contained in:
silver 2025-09-05 21:35:37 +01:00
parent b742a09c43
commit f47e95c61d
Signed by: silver
GPG key ID: 36F93D61BAD3FD7D

View file

@ -45,7 +45,7 @@ in {
};
# might not be required
# networking.firewall.allowedTCPPorts = [8089];
networking.firewall.allowedTCPPorts = [8089];
# set up the core files
systemd.services."${name}_prestart" = {
@ -137,21 +137,31 @@ in {
];
path = with pkgs; [util-linux toybox];
serviceConfig = {
Type = "oneshot";
User = cfg.user.user;
Group = cfg.user.group;
TimeoutSec = "infinity";
Restart = "on-failure";
# WorkingDirectory = "${cfg.package}/share/gitlab";
# Slice = "system-gitlab.slice";
RemainAfterExit = true;
Type = "simple";
Restart="always";
Environment = "SPLUNK_HOME=${cfg.user.home}";
ExecStart = "${package}/bin/splunk _internal_launch_under_systemd";
# no so sure about these
KillMode="mixed";
KillSignal="SIGINT";
TimeoutStopSec=360;
LimitNOFILE=65536;
LimitRTPRIO=99;
SuccessExitStatus="51 52";
RestartPreventExitStatus=51;
RestartForceExitStatus=52;
User = cfg.user.user;
Group = cfg.user.group;
NoNewPrivileges = "yes";
AmbientCapabilities = "CAP_DAC_READ_SEARCH";
# ExecStartPre=-/bin/bash -c "chown -R splunk:splunk /opt/splunkforwarder"
Delegate="true";
# CPUShares=1024;
# MemoryLimit=3973632000;
PermissionsStartOnly="true";
# ExecStartPost=-/bin/bash -c "chown -R splunk:splunk /sys/fs/cgroup/cpu/system.slice/%n"
# ExecStartPost=-/bin/bash -c "chown -R splunk:splunk /sys/fs/cgroup/memory/system.slice/%n"
};
};
};