From 71c01795f46acade07c93dc3191299f367faaa71 Mon Sep 17 00:00:00 2001 From: Colin Date: Fri, 15 Sep 2023 07:34:50 +0000 Subject: [PATCH] moby: eg25-control-freshen-agps: fix to actually run hourly --- modules/services/eg25-control.nix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/modules/services/eg25-control.nix b/modules/services/eg25-control.nix index fdd0fee8..3f20e760 100644 --- a/modules/services/eg25-control.nix +++ b/modules/services/eg25-control.nix @@ -69,23 +69,24 @@ in systemd.services.eg25-control-freshen-agps = { description = "keep assisted-GPS data fresh"; serviceConfig = { - Type = "oneshot"; + # XXX: this can have a race condition with eg25-control-gps + # - eg25-control-gps initiates DL of new/ + # - eg25-control-gps tests new/: it works + # - eg25-control-freshen-agps initiates DL of new/ + # - eg25-control-gps: moves new/ into cache/ + # - but it moved the result (possibly incomplete) of eg25-control-freshen-agps, incorrectly + # in practice, i don't expect much issue from this. ExecStart = "${cfg.package}/bin/eg25-control --ensure-agps-cache --verbose"; + Restart = "no"; User = "eg25-control"; WorkingDirectory = "/var/lib/eg25-control"; StateDirectory = "eg25-control"; }; + startAt = "hourly"; # this is a bit more than necessary, but idk systemd calendar syntax after = [ "network-online.target" "nss-lookup.target" ]; requires = [ "network-online.target" ]; - }; - - systemd.timers.eg25-control-freshen-agps = { - wantedBy = [ "multi-user.target" ]; - timerConfig = { - OnCalender = "hourly"; # this is a bit more than necessary, but idk systemd calendar syntax - OnStartupSec = "3min"; - }; + # wantedBy = [ "network-online.target" ]; # auto-start immediately after boot }; }; }