Keepalive only after main service started, delay before starting silent fans

This commit is contained in:
2025-12-31 00:05:51 -08:00
parent df8fcec4d9
commit 0cc3d6483c

View File

@@ -37,28 +37,36 @@
systemd = { systemd = {
services.hpe-ilo-keepalive = { services.hpe-ilo-keepalive = {
enable = true; enable = true;
after = [ "network.target" ]; after = [
"network.target"
"hpe-silent-fans.service"
];
wantedBy = [ "multi-user.target" ];
description = "Maintains ilo ssh session via sending periodic command"; description = "Maintains ilo ssh session via sending periodic command";
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "simple";
ExecStart = ''screen -S ilofansession -X stuff "fan info^M"''; ExecStart = ''screen -S ilofansession -X stuff "fan info^M"'';
}; };
path = with pkgs; [ path = with pkgs; [
bash bash
screen
config.programs.ssh.package config.programs.ssh.package
screen
sleep
]; ];
startAt = "*:0/5";
}; };
services.hpe-silent-fans = { services.hpe-silent-fans = {
enable = true; enable = true;
after = [ "network.target" ]; after = [ "network.target" ];
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
description = "Lowers fan speeds by using ilo over ssh to manually set fan parameters."; description = "Lowers fan speeds by using ilo over ssh to manually set fan parameters";
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "simple";
ExecStartPre = ''${pkgs.sleep}/bin/sleep 30'';
ExecStart = "${pkgs.writeShellScript "hpe-silent-fans.sh" '' ExecStart = "${pkgs.writeShellScript "hpe-silent-fans.sh" ''
set -e set -e
@@ -97,18 +105,20 @@
path = with pkgs; [ path = with pkgs; [
bash bash
screen
config.programs.ssh.package config.programs.ssh.package
coreutils
screen
]; ];
}; };
timers.hpe-ilo-keepalive = { # timers.hpe-ilo-keepalive = {
wantedBy = [ "timers.target" ]; # wantedBy = [ "timers.target" ];
timerConfig = { # timerConfig = {
OnCalendar = "*-*-* *:0/5:00"; # OnBootSec = "5m";
Unit = "hpe-ilo-keepalive.service"; # OnCalendar = "*-*-* *:0/5:00";
}; # Unit = "hpe-ilo-keepalive.service";
}; # };
# };
}; };
# This value determines the NixOS release from which the default # This value determines the NixOS release from which the default