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.

53 lines
886 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. [ -d /var/run/prosody ] || {
  14. mkdir -m 0755 -p /var/run/prosody
  15. chown prosody:prosody /var/run/prosody
  16. }
  17. [ -d /var/log/prosody ] || {
  18. mkdir -m 0755 -p /var/log/prosody
  19. chown prosody:prosody /var/log/prosody
  20. }
  21. [ -d /var/log/prosody ] && {
  22. chown -R prosody:prosody /etc/prosody
  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. $BIN start
  33. }
  34. stop() {
  35. $BIN stop
  36. }
  37. reload() {
  38. [ -f $PID_F ] && kill -HUP $(cat $PID_F)
  39. }
  40. status() {
  41. $BIN status
  42. }