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 pleroma/pleroma!4303
This commit is contained in:
commit
d1bb0586dc
3 changed files with 19 additions and 2 deletions
changelog.d
installation/init.d
rel/files/installation/init.d
1
changelog.d/opt-init.d-migrations.change
Normal file
1
changelog.d/opt-init.d-migrations.change
Normal file
|
@ -0,0 +1 @@
|
|||
- OpenRC: Automatically run migrations before starting pleroma
|
|
@ -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
|
||||
|
|
|
@ -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 "$?"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue