logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

prosody.initd-r5 (987B)


  1. #!/sbin/openrc-run
  2. # Copyright 1999-2021 Gentoo Authors
  3. # Distributed under the terms of the GNU General Public License v2
  4. name="Prosody XMPP server"
  5. extra_started_commands="reload"
  6. jabber_pid="/run/jabber"
  7. jabber_logs="/var/log/jabber"
  8. pidfile="${jabber_pid}/prosody.pid"
  9. prosody_config="/etc/jabber/prosody.cfg.lua"
  10. command="/usr/bin/prosody"
  11. commandctl="/usr/bin/prosodyctl"
  12. command_group="jabber"
  13. command_user="jabber"
  14. checkconfig() {
  15. if [ ! -f "${prosody_config}" ]; then
  16. eerror "Please create ${prosody_config} before starting Prosody!"
  17. return 1
  18. fi
  19. ${commandctl} check config
  20. return $?
  21. }
  22. depend() {
  23. need net
  24. provide jabber-server
  25. use dns postgresql
  26. }
  27. reload() {
  28. ebegin "Reloading configuration"
  29. start-stop-daemon --signal HUP --pidfile "${pidfile}"
  30. eend $?
  31. }
  32. start_pre() {
  33. checkconfig || return 1
  34. checkpath -d -m 0750 -o "${command_user}:${command_group}" -q "${jabber_logs}"
  35. checkpath -d -m 0750 -o "${command_user}:${command_group}" -q "${jabber_pid}"
  36. }