logo

pleroma

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

pleroma (969B)


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