1
0
Fork 0
mirror of https://git.pleroma.social/pleroma/pleroma.git synced 2025-04-09 04:24:07 +00:00

Merge branch 'opt-init.d-migrations' into 'develop'

OpenRC: Automatically run migrations before starting pleroma

See merge request 
This commit is contained in:
Haelwenn 2025-03-23 19:11:42 +00:00
commit d1bb0586dc
3 changed files with 19 additions and 2 deletions
changelog.d
installation/init.d
rel/files/installation/init.d

View file

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

View file

@ -37,6 +37,12 @@ depend() {
need nginx postgresql
}
start_pre() {
ebegin "running migrations if any"
su -s /bin/sh -c '/usr/bin/mix ecto.migrate' -l "${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

@ -16,7 +16,17 @@ 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
want nginx
need postgresql
}
start_pre() {
ebegin "running migrations if any"
su -s /bin/sh -c '/opt/pleroma/bin/pleroma_ctl migrate' -l "${command_user}"
eend "$?"
}