From c0f965fb8e4c20d8ae1dd8e4054eb7eb997827a9 Mon Sep 17 00:00:00 2001 From: Inex Code Date: Tue, 24 Dec 2024 19:10:38 +0300 Subject: [PATCH] fix: Pleroma startup --- postgresql/upgrade12to16.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/postgresql/upgrade12to16.nix b/postgresql/upgrade12to16.nix index 93a8766..9f53d16 100644 --- a/postgresql/upgrade12to16.nix +++ b/postgresql/upgrade12to16.nix @@ -110,6 +110,8 @@ in --link \ --verbose + touch "$newDataDir/.sp_migrated" + echo "PostgreSQL upgrade from 12 to 16 completed." else echo "No PostgreSQL 12 data directory detected or already upgraded. Skipping." @@ -119,8 +121,10 @@ in # Start Pleroma only if pleromaEnabled is true ExecStartPost = optional cfg.pleromaEnabled "${pkgs.writeShellScript "postgresql-upgrade12to16-post.sh" '' - if [ -d "${cfg.dataDir12}" ] && [ ! -d "${cfg.dataDir16}" ]; then + if test -e "${cfg.dataDir16}/.sp_migrated"; then ${pkgs.systemd}/bin/systemctl start --no-block pleroma.service + + rm -f "${cfg.dataDir16}/.sp_migrated" fi '' }";