init.d/pleroma: Add option to attach an elixir console

This commit is contained in:
Haelwenn (lanodan) Monnier 2019-09-21 03:15:09 +02:00
parent 79376abae3
commit 528069a42d
No known key found for this signature in database
GPG Key ID: D5B7A8E43C997DEE
1 changed files with 18 additions and 3 deletions

View File

@ -3,8 +3,23 @@
# Requires OpenRC >= 0.35
directory=/opt/pleroma
command=/usr/bin/mix
command_args="phx.server"
# put my_allow_console=YES in /etc/conf.d/pleroma if you want to be able to
# connect to pleroma via an elixir console
if yesno "${my_allow_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"
my_extra_deps="epmd"
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"
my_extra_deps=""
fi
command_user=pleroma:pleroma
command_background=1
@ -17,5 +32,5 @@ retry="SIGTERM/30/SIGKILL/5"
pidfile="/var/run/pleroma.pid"
depend() {
need nginx postgresql
need nginx postgresql "${my_extra_deps}"
}