You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
916 B

  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2011-2016 OpenWrt.org
  3. START=99
  4. USE_PROCD=1
  5. BIN=/usr/bin/prosodyctl
  6. LOG_D=/var/log/prosody
  7. RUN_D=/var/run/prosody
  8. PID_F=$RUN_D/prosody.pid
  9. RUN_USER=prosody
  10. RUN_GROUP=prosody
  11. start_service() {
  12. [ -d /var/run/prosody ] || {
  13. mkdir -m 0755 -p /var/run/prosody
  14. chown prosody:prosody /var/run/prosody
  15. }
  16. [ -d /var/log/prosody ] || {
  17. mkdir -m 0755 -p /var/log/prosody
  18. chown prosody:prosody /var/log/prosody
  19. }
  20. [ -d /var/log/prosody ] && {
  21. chown -R root:prosody /etc/prosody
  22. chown -R prosody:prosody /etc/prosody/data
  23. }
  24. [ -f /sbin/paxctl ] && {
  25. paxctl -v /usr/bin/ > /dev/null 2>&1
  26. [ $? -ne 0 ] && {
  27. cp /usr/bin/lua /tmp
  28. paxctl -c -m /tmp/lua
  29. cp -f /tmp/lua /usr/bin/lua
  30. }
  31. }
  32. procd_open_instance
  33. procd_set_param command "$BIN" start
  34. procd_set_param file /etc/prosody/prosody.cfg.lua
  35. procd_close_instance
  36. }
  37. stop_service() {
  38. ${BIN} stop
  39. }