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.

41 lines
770 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. start_service() {
  7. [ -d /var/run/prosody ] || {
  8. mkdir /var/run/prosody
  9. chmod 0755 /var/run/prosody
  10. chown prosody:prosody /var/run/prosody
  11. }
  12. [ -d /var/log/prosody ] || {
  13. mkdir /var/log/prosody
  14. chmod 0755 /var/log/prosody
  15. chown prosody:prosody /var/log/prosody
  16. }
  17. [ -d /var/log/prosody ] && {
  18. chown -R root:prosody /etc/prosody
  19. chown -R prosody:prosody /etc/prosody/data
  20. }
  21. procd_open_instance
  22. procd_set_param command "$BIN" start
  23. procd_set_param file /etc/prosody/prosody.cfg.lua
  24. procd_set_param user prosody
  25. procd_set_param group prosody
  26. procd_close_instance
  27. }
  28. stop_service() {
  29. ${BIN} stop
  30. }
  31. reload_service() {
  32. ${BIN} reload
  33. }