From 620f813ef4019c5f409f0e4ede7d08ccdf5a3c0f Mon Sep 17 00:00:00 2001 From: Philipp <1329940+pstn@users.noreply.github.com> Date: Mon, 4 Aug 2025 09:57:06 +0200 Subject: [PATCH] nixos/services.mysql: Fix restart on-abnormal --- nixos/doc/manual/release-notes/rl-2511.section.md | 2 ++ nixos/modules/services/databases/mysql.nix | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/nixos/doc/manual/release-notes/rl-2511.section.md b/nixos/doc/manual/release-notes/rl-2511.section.md index 4f51b1e520e6..989fc053aebb 100644 --- a/nixos/doc/manual/release-notes/rl-2511.section.md +++ b/nixos/doc/manual/release-notes/rl-2511.section.md @@ -111,6 +111,8 @@ - The `services.postgresql` module now sets up a systemd unit `postgresql.target`. Depending on `postgresql.target` guarantees that postgres is in read-write mode and initial/ensure scripts were executed. Depending on `postgresql.service` only guarantees a read-only connection. +- The `services.mysql` module now restarts the database `on-abnormal`, which means that it now will be restarted in certain situations, it wasn't before. For example an OOM-kill. + - The `services.siproxd` module has been removed as `siproxd` is unmaintained and broken with libosip 5.x. - `netbox-manage` script created by the `netbox` module no longer uses `sudo -u netbox` internally. It can be run as root and will change it's user to `netbox` using `runuser` diff --git a/nixos/modules/services/databases/mysql.nix b/nixos/modules/services/databases/mysql.nix index 28fac48844fa..3d65823c73d8 100644 --- a/nixos/modules/services/databases/mysql.nix +++ b/nixos/modules/services/databases/mysql.nix @@ -691,7 +691,7 @@ in serviceConfig = lib.mkMerge [ { Type = if hasNotify then "notify" else "simple"; - Restart = "on-abort"; + Restart = "on-abnormal"; RestartSec = "5s"; # User and group