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.

55 lines
982 B

  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2010-2011 OpenWrt.org
  3. START=99
  4. EXTRA_COMMANDS="status"
  5. EXTRA_HELP=" status Print the status of the service"
  6. BIN=/usr/bin/prosodyctl
  7. LOG_D=/var/log/prosody
  8. RUN_D=/var/run/prosody
  9. PID_F=$RUN_D/prosody.pid
  10. RUN_USER=prosody
  11. RUN_GROUP=prosody
  12. start() {
  13. user_exists prosody 54 || user_add prosody 54
  14. group_exists prosody 54 || group_add prosody 54
  15. [ -d /var/run/prosody ] || {
  16. mkdir -m 0755 -p /var/run/prosody
  17. chown prosody:prosody /var/run/prosody
  18. }
  19. [ -d /var/log/prosody ] || {
  20. mkdir -m 0755 -p /var/log/prosody
  21. chown prosody:prosody /var/log/prosody
  22. }
  23. [ -d /var/log/prosody ] && {
  24. chown -R prosody:prosody /etc/prosody
  25. }
  26. [ -f /sbin/paxctl ] && {
  27. paxctl -v /usr/bin/ > /dev/null 2>&1
  28. [ $? -ne 0 ] && {
  29. cp /usr/bin/lua /tmp
  30. paxctl -c -m /tmp/lua
  31. cp -f /tmp/lua /usr/bin/lua
  32. }
  33. }
  34. $BIN start
  35. }
  36. stop() {
  37. $BIN stop
  38. }
  39. reload() {
  40. [ -f $PID_F ] && kill -HUP $(cat $PID_F)
  41. }
  42. status() {
  43. $BIN status
  44. }