logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git

pleroma (1044B)


  1. #!/bin/sh
  2. # PROVIDE: pleroma
  3. # REQUIRE: DAEMON pgsql nginx
  4. if [ -f /etc/rc.subr ]; then
  5. . /etc/rc.subr
  6. fi
  7. pleroma_home="/home/pleroma"
  8. pleroma_user="pleroma"
  9. name="pleroma"
  10. rcvar=${name}
  11. command="/usr/pkg/bin/elixir"
  12. command_args="--detached -S /usr/pkg/bin/mix phx.server"
  13. start_precmd="ulimit -n unlimited"
  14. pidfile="/dev/null"
  15. pleroma_chdir="${pleroma_home}/pleroma"
  16. pleroma_env="HOME=${pleroma_home} MIX_ENV=prod"
  17. check_pidfile()
  18. {
  19. pid=$(pgrep -U "${pleroma_user}" /bin/beam.smp$)
  20. printf '%s' "${pid}"
  21. }
  22. if [ -f /etc/rc.subr ] && [ -d /etc/rc.d ] && [ -f /etc/rc.d/DAEMON ]; then
  23. # newer NetBSD
  24. load_rc_config ${name}
  25. run_rc_command "$1"
  26. else
  27. # ancient NetBSD, Solaris and illumos, Linux, etc...
  28. cmd=${1:-start}
  29. case ${cmd} in
  30. start)
  31. echo "Starting ${name}."
  32. ${start_cmd}
  33. ;;
  34. stop)
  35. echo "Stopping ${name}."
  36. check_pidfile
  37. ! [ -n "${pid}" ] && kill "${pid}"
  38. ;;
  39. restart)
  40. ( $0 stop )
  41. sleep 5
  42. $0 start
  43. ;;
  44. *)
  45. echo 1>&2 "Usage: $0 [start|stop|restart]"
  46. exit 1
  47. ;;
  48. esac
  49. exit 0
  50. fi