diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2024-02-10 12:48:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-10 12:48:05 +0100 |
commit | 66a0b77a7822be65e0c5131cb46a012284cfebf5 (patch) | |
tree | f745b88f6ca3b40bd79a7ea25f2e7c9b29587fa4 /nixos | |
parent | f5ccf81a9c53c9fa9f5b78a77a8a3611b8e47815 (diff) | |
parent | c64c45da9c541c1f923815fd0e512045f91accee (diff) | |
download | nixlib-66a0b77a7822be65e0c5131cb46a012284cfebf5.tar nixlib-66a0b77a7822be65e0c5131cb46a012284cfebf5.tar.gz nixlib-66a0b77a7822be65e0c5131cb46a012284cfebf5.tar.bz2 nixlib-66a0b77a7822be65e0c5131cb46a012284cfebf5.tar.lz nixlib-66a0b77a7822be65e0c5131cb46a012284cfebf5.tar.xz nixlib-66a0b77a7822be65e0c5131cb46a012284cfebf5.tar.zst nixlib-66a0b77a7822be65e0c5131cb46a012284cfebf5.zip |
Merge pull request #286394 from SuperSandro2000/nextcloud-timer
nixos/nextcloud: don't execute cron when in maintenace/upgrade, don't kill cgroup
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/web-apps/nextcloud.nix | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/nixos/modules/services/web-apps/nextcloud.nix b/nixos/modules/services/web-apps/nextcloud.nix index 8669f84b1cbb..08f90dcf59d8 100644 --- a/nixos/modules/services/web-apps/nextcloud.nix +++ b/nixos/modules/services/web-apps/nextcloud.nix @@ -873,9 +873,11 @@ in { { systemd.timers.nextcloud-cron = { wantedBy = [ "timers.target" ]; after = [ "nextcloud-setup.service" ]; - timerConfig.OnBootSec = "5m"; - timerConfig.OnUnitActiveSec = "5m"; - timerConfig.Unit = "nextcloud-cron.service"; + timerConfig = { + OnBootSec = "5m"; + OnUnitActiveSec = "5m"; + Unit = "nextcloud-cron.service"; + }; }; systemd.tmpfiles.rules = map (dir: "d ${dir} 0750 nextcloud nextcloud - -") [ @@ -992,15 +994,21 @@ in { nextcloud-cron = { after = [ "nextcloud-setup.service" ]; environment.NEXTCLOUD_CONFIG_DIR = "${datadir}/config"; - serviceConfig.Type = "oneshot"; - serviceConfig.User = "nextcloud"; - serviceConfig.ExecStart = "${phpPackage}/bin/php -f ${webroot}/cron.php"; + serviceConfig = { + Type = "oneshot"; + User = "nextcloud"; + ExecCondition = "${lib.getExe phpPackage} -f ${webroot}/occ status -e"; + ExecStart = "${lib.getExe phpPackage} -f ${webroot}/cron.php"; + KillMode = "process"; + }; }; nextcloud-update-plugins = mkIf cfg.autoUpdateApps.enable { after = [ "nextcloud-setup.service" ]; - serviceConfig.Type = "oneshot"; - serviceConfig.ExecStart = "${occ}/bin/nextcloud-occ app:update --all"; - serviceConfig.User = "nextcloud"; + serviceConfig = { + Type = "oneshot"; + ExecStart = "${occ}/bin/nextcloud-occ app:update --all"; + User = "nextcloud"; + }; startAt = cfg.autoUpdateApps.startAt; }; }; |