aboutsummaryrefslogtreecommitdiff
path: root/installation/init.d
diff options
context:
space:
mode:
authordcc <dcc@logografos.com>2024-05-15 00:57:23 -0700
committerdcc <dcc@logografos.com>2024-05-15 00:57:23 -0700
commitb31a934a804aed3f35442ceafe2080b0955e7317 (patch)
tree947b13a0388ecea81e05dd980baa10f7546860b9 /installation/init.d
parentea33a0d3427f8b30b82a6ddbc0ff7429cfaf8d91 (diff)
downloadanni-b31a934a804aed3f35442ceafe2080b0955e7317.tar.gz
anni-b31a934a804aed3f35442ceafe2080b0955e7317.tar.bz2
anni-b31a934a804aed3f35442ceafe2080b0955e7317.zip
total rebaseHEADmaster
Diffstat (limited to 'installation/init.d')
-rwxr-xr-xinstallation/init.d/pleroma46
1 files changed, 46 insertions, 0 deletions
diff --git a/installation/init.d/pleroma b/installation/init.d/pleroma
new file mode 100755
index 0000000..cb6635a
--- /dev/null
+++ b/installation/init.d/pleroma
@@ -0,0 +1,46 @@
+#!/sbin/openrc-run
+supervisor=supervise-daemon
+command_user=pleroma:pleroma
+command_background=1
+# Ask process to terminate within 30 seconds, otherwise kill it
+retry="SIGTERM/30/SIGKILL/5"
+pidfile="/var/run/pleroma.pid"
+directory=/opt/pleroma
+healthcheck_delay=60
+healthcheck_timer=30
+no_new_privs="yes"
+
+: ${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
+
+depend() {
+ 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"
+}