Created
October 9, 2018 20:34
-
-
Save feld/7c1b166764b5ecabec892ce3a2200d25 to your computer and use it in GitHub Desktop.
pleroma rc script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# $FreeBSD$ | |
# | |
# PROVIDE: pleroma | |
# REQUIRE: LOGIN | |
# | |
# Add the following line to /etc/rc.conf to enable pleroma: | |
# | |
# pleroma_enable="YES" | |
# | |
pleroma_enable=${pleroma_enable:-"NO"} | |
. /etc/rc.subr | |
name=pleroma | |
rcvar=pleroma_enable | |
load_rc_config ${name} | |
: ${pleroma_user:=pleroma} | |
export MIX_ENV=prod | |
export PATH=${PATH}:/usr/local/bin:/usr/local/sbin | |
export LANG=en_US.UTF-8 | |
export LC_ALL=en_US.UTF-8 | |
pidfile=/var/run/pleroma/pleroma.pid | |
pleroma_chdir=/usr/local/pleroma | |
procname=*beam.smp | |
start_precmd=pleroma_prestart | |
extra_commands=status | |
command="/usr/sbin/daemon" | |
command_args="-p ${pidfile} -o /var/log/pleroma.log /usr/local/bin/mix phx.server" | |
pleroma_prestart() | |
{ | |
cd /usr/local/pleroma | |
if [ ! -d /usr/local/pleroma/uploads ]; then | |
install -d -o pleroma -g wheel -m 755 /usr/local/pleroma/uploads | |
fi | |
if [ ! -d /var/run/pleroma ]; then | |
install -d -o pleroma -g wheel -m 755 /var/run/pleroma | |
fi | |
su -m pleroma -c '/usr/local/bin/mix compile | logger -t pleroma' | |
su -m pleroma -c '/usr/local/bin/mix phx.digest | logger -t pleroma' | |
#su -m pleroma -c '/usr/local/bin/mix | logger -t pleroma' | |
su -m pleroma -c '/usr/local/bin/mix ecto.migrate | logger -t pleroma' | |
#chown -R pleroma:wheel _build uploads | |
} | |
run_rc_command "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment