From 528069a42d53807ee068a6e6b59bfce62e74409d Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sat, 21 Sep 2019 03:15:09 +0200 Subject: [PATCH] init.d/pleroma: Add option to attach an elixir console --- installation/init.d/pleroma | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/installation/init.d/pleroma b/installation/init.d/pleroma index ed50bb551..4c96eb42b 100755 --- a/installation/init.d/pleroma +++ b/installation/init.d/pleroma @@ -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}" }