Merge pull request 'OpenRC: Automatically run migrations before starting pleroma' (#7680) from gitlab-mr-iid-4303 into develop

Reviewed-on: https://git.pleroma.social/pleroma/pleroma/pulls/7680
This commit is contained in:
lain 2026-07-29 11:07:32 +00:00
commit e143e645d3
3 changed files with 17 additions and 2 deletions

View file

@ -0,0 +1 @@
- OpenRC: Automatically run migrations before starting pleroma

View file

@ -37,6 +37,13 @@ depend() {
need nginx postgresql
}
start_pre() {
ebegin "running migrations if any"
su -s /bin/sh -c "cd \"${directory}\" && exec /usr/bin/mix ecto.migrate" \
"${command_user%%:*}"
eend "$?"
}
healthcheck() {
# put pleroma_health=YES in /etc/conf.d/pleroma if you want healthchecking
# and make sure you have curl installed

View file

@ -17,6 +17,13 @@ retry="SIGTERM/30/SIGKILL/5"
pidfile="/var/run/pleroma.pid"
depend() {
want nginx
need postgresql
want nginx
need postgresql
}
start_pre() {
ebegin "running migrations if any"
su -s /bin/sh -c "cd \"${directory}\" && exec /opt/pleroma/bin/pleroma_ctl migrate" \
"${command_user%%:*}"
eend "$?"
}