2018-08-22 20:27:15 +00:00
|
|
|
#!/sbin/openrc-run
|
2019-09-21 01:15:09 +00:00
|
|
|
supervisor=supervise-daemon
|
2018-08-22 20:27:15 +00:00
|
|
|
command_user=pleroma:pleroma
|
|
|
|
command_background=1
|
|
|
|
# Ask process to terminate within 30 seconds, otherwise kill it
|
2019-01-28 08:18:11 +00:00
|
|
|
retry="SIGTERM/30/SIGKILL/5"
|
2018-08-22 20:27:15 +00:00
|
|
|
pidfile="/var/run/pleroma.pid"
|
2019-09-21 01:15:09 +00:00
|
|
|
directory=/opt/pleroma
|
|
|
|
healthcheck_delay=60
|
|
|
|
healthcheck_timer=30
|
|
|
|
|
|
|
|
: ${pleroma_port:-4000}
|
|
|
|
|
|
|
|
# Needs OpenRC >= 0.42
|
|
|
|
#respawn_max=0
|
|
|
|
#respawn_delay=5
|
|
|
|
|
|
|
|
# put pleroma_console=YES in /etc/conf.d/pleroma if you want to be able to
|
|
|
|
# connect to pleroma via an elixir console
|
|
|
|
if yesno "${pleroma_console}"; then
|
|
|
|
command=elixir
|
|
|
|
command_args="--name pleroma@127.0.0.1 --erl '-kernel inet_dist_listen_min 9001 inet_dist_listen_max 9001 inet_dist_use_interface {127,0,0,1}' -S mix phx.server"
|
|
|
|
|
|
|
|
start_post() {
|
|
|
|
einfo "You can get a console by using this command as pleroma's user:"
|
|
|
|
einfo "iex --name console@127.0.0.1 --remsh pleroma@127.0.0.1"
|
|
|
|
}
|
|
|
|
else
|
|
|
|
command=/usr/bin/mix
|
|
|
|
command_args="phx.server"
|
|
|
|
fi
|
|
|
|
|
|
|
|
export MIX_ENV=prod
|
2018-08-22 20:27:15 +00:00
|
|
|
|
|
|
|
depend() {
|
2019-09-21 01:15:09 +00:00
|
|
|
need nginx postgresql
|
|
|
|
}
|
|
|
|
|
|
|
|
healthcheck() {
|
|
|
|
# put pleroma_health=YES in /etc/conf.d/pleroma if you want healthchecking
|
|
|
|
# and make sure you have curl installed
|
|
|
|
yesno "$pleroma_health" || return 0
|
|
|
|
|
|
|
|
curl -q "localhost:${pleroma_port}/api/pleroma/healthcheck"
|
2019-02-10 19:25:34 +00:00
|
|
|
}
|