summaryrefslogtreecommitdiff
path: root/installation
diff options
context:
space:
mode:
authorFarhan Khan <farhan@farhan.codes>2020-08-06 00:01:57 -0400
committerFarhan Khan <farhan@farhan.codes>2020-08-13 18:59:13 -0400
commit07376bd21ae732a00c61ce55be920ddf8ba603ee (patch)
tree1607849ad1c564f413777e199e125497eff516b4 /installation
parent014f91c1c3504d7e1f4407491d42223c79c0de05 (diff)
Adding installation documentation for FreeBSD + rc.d script
Diffstat (limited to 'installation')
-rwxr-xr-xinstallation/freebsd/rc.d/pleroma28
1 files changed, 28 insertions, 0 deletions
diff --git a/installation/freebsd/rc.d/pleroma b/installation/freebsd/rc.d/pleroma
new file mode 100755
index 000000000..1e41e57e6
--- /dev/null
+++ b/installation/freebsd/rc.d/pleroma
@@ -0,0 +1,28 @@
+#!/bin/sh
+# REQUIRE: DAEMON postgresql
+# PROVIDE: pleroma
+
+# sudo -u pleroma MIX_ENV=prod elixir --erl \"-detached\" -S mix phx.server
+
+. /etc/rc.subr
+
+name="pleroma"
+desc="Pleroma Social Media Platform"
+rcvar=${name}_enable
+command="/usr/local/bin/elixir"
+command_args="--erl \"-detached\" -S /usr/local/bin/mix phx.server"
+pidfile="/dev/null"
+
+pleroma_user="pleroma"
+pleroma_home="/home/pleroma"
+pleroma_chdir="${pleroma_home}/pleroma"
+pleroma_env="HOME=${pleroma_home} MIX_ENV=prod"
+
+check_pidfile()
+{
+ pid=$(pgrep beam.smp$)
+ echo -n "${pid}"
+}
+
+load_rc_config ${name}
+run_rc_command "$1"