From 8943ab8140c4bb160b9e3d5df5ee8bb2c3410a41 Mon Sep 17 00:00:00 2001 From: Lain Soykaf Date: Wed, 29 Jul 2026 15:02:16 +0400 Subject: [PATCH] fix(openrc): preserve migration execution context --- installation/init.d/pleroma | 3 ++- rel/files/installation/init.d/pleroma | 7 ++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/installation/init.d/pleroma b/installation/init.d/pleroma index 2cd366140..3b584bd45 100755 --- a/installation/init.d/pleroma +++ b/installation/init.d/pleroma @@ -39,7 +39,8 @@ depend() { start_pre() { ebegin "running migrations if any" - su -s /bin/sh -c '/usr/bin/mix ecto.migrate' -l "${command_user}" + su -s /bin/sh -c "cd \"${directory}\" && exec /usr/bin/mix ecto.migrate" \ + "${command_user%%:*}" eend "$?" } diff --git a/rel/files/installation/init.d/pleroma b/rel/files/installation/init.d/pleroma index 0e117e9b8..2d3977e41 100755 --- a/rel/files/installation/init.d/pleroma +++ b/rel/files/installation/init.d/pleroma @@ -16,10 +16,6 @@ retry="SIGTERM/30/SIGKILL/5" pidfile="/var/run/pleroma.pid" -# Needs OpenRC >= 0.42 -respawn_max=200 -respawn_period=86400 # 1*day - depend() { want nginx need postgresql @@ -27,6 +23,7 @@ depend() { start_pre() { ebegin "running migrations if any" - su -s /bin/sh -c '/opt/pleroma/bin/pleroma_ctl migrate' -l "${command_user}" + su -s /bin/sh -c "cd \"${directory}\" && exec /opt/pleroma/bin/pleroma_ctl migrate" \ + "${command_user%%:*}" eend "$?" }