Skip to content

Commit

Permalink
Really always restart systemd units
Browse files Browse the repository at this point in the history
  • Loading branch information
contrun committed Oct 19, 2024
1 parent 9386847 commit 97db21c
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions nix/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,13 @@ in {
in {
TimeoutStartSec = "infinity";
Restart = "always";
# Disable start limit.
# https://unix.stackexchange.com/questions/289629/systemd-restart-always-is-not-honored
StartLimitIntervalSec = 0;
# The first delay is approximately half a second.
RestartSteps = 20;
# 2^20s. A little over one month.
RestartSecMax = 104857;
# watch and repeat parameter can't handle non-existent folders.
# So we have to run unison without watch and repeat first.
ExecStartPre = "-${pkgs.unison}/bin/unison ${commonArgs} %i";
Expand Down Expand Up @@ -1200,6 +1207,14 @@ in {
};
Timer = { OnBootSec = "3min"; };
Service = {
Restart = "always";
# Disable start limit.
# https://unix.stackexchange.com/questions/289629/systemd-restart-always-is-not-honored
StartLimitIntervalSec = 0;
# The first delay is approximately half a second.
RestartSteps = 20;
# 2^20s. A little over one month.
RestartSecMax = 104857;
# It is ok to pass a non-existent key file. Ssh will warn us, but won't panic.
ExecStart =
"${pkgs.autossh}/bin/autossh -i %h/.ssh/id_ed25519_autossh $SSH_OPTIONS %i";
Expand Down

0 comments on commit 97db21c

Please sign in to comment.