Skip to content

Instantly share code, notes, and snippets.

@feld
Created October 9, 2018 20:49
Show Gist options
  • Save feld/d3fb3f563f58109e7a45f63f0cbb591c to your computer and use it in GitHub Desktop.
Save feld/d3fb3f563f58109e7a45f63f0cbb591c to your computer and use it in GitHub Desktop.
pleroma daemontools run script
#!/bin/sh
exec 2>&1
export MIX_ENV=prod
export HOME=/usr/local/pleroma
export PATH=${PATH}:/usr/local/bin:/usr/local/sbin
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
#export ERL_COMPILER_OPTIONS="native"
#export ERL_INETRC=/usr/local/etc/pleroma/erl_inetrc
#export ELIXIR_ERL_OPTIONS="-kernel inetrc '/usr/local/etc/pleroma/erl_inetrc'"
cd /usr/local/pleroma
if [ ! -d /usr/local/pleroma/uploads ]; then
install -d -o pleroma -g wheel -m 755 /usr/local/pleroma/uploads
fi
#setuidgid pleroma /usr/local/bin/mix deps.clean --all | logger -t pleroma
setuidgid pleroma /usr/local/bin/mix deps.get | logger -t pleroma
setuidgid pleroma /usr/local/bin/mix clean | logger -t pleroma
setuidgid pleroma /usr/local/bin/mix compile | logger -t pleroma
#setuidgid pleroma /usr/local/bin/mix phx.digest | logger -t pleroma
#setuidgid pleroma /usr/local/bin/mix | logger -t pleroma
setuidgid pleroma /usr/local/bin/mix ecto.migrate | logger -t pleroma
exec setuidgid pleroma /usr/local/bin/elixir --erl '-kernel inetrc "/usr/local/etc/pleroma/erl_inetrc"' -S mix phx.server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment