burp.initd 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #!/sbin/openrc-run
  2. # Copyright 1999-2016 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. BURP_CONFIG="/etc/burp/burp-server.conf"
  5. description="Burp is a network backup and restore program"
  6. command="/usr/sbin/burp"
  7. command_args="-c '${BURP_CONFIG}' -F"
  8. command_background="yes"
  9. pidfile="/run/burp-server.pid"
  10. start_stop_daemon_arg="--make-pidfile --wait 500"
  11. extra_started_commands="reload summary"
  12. description_reload="Reloads configuration"
  13. description_summary="Displays main status monitor summary"
  14. get_backup_dir() {
  15. grep '^directory = ' "${BURP_CONFIG}" \
  16. | sed -e 's/^directory = //'
  17. }
  18. depend() {
  19. need localmount
  20. after bootmisc
  21. use net
  22. }
  23. start_pre() {
  24. checkpath -o root:burp -m 0775 -d /etc/burp
  25. checkpath -o root:burp -m 0640 -f /etc/burp/burp-server.conf
  26. checkpath -o root:burp -m 0750 -d /etc/burp/clientconfdir
  27. checkpath -o burp:burp -m 0775 -d /run/lock/burp
  28. checkpath -o root:burp -m 0770 -d "$(get_backup_dir)"
  29. }
  30. reload() {
  31. ebegin "Reloading ${SVCNAME} configuration"
  32. start-stop-daemon --exec ${command} --signal HUP
  33. eend $?
  34. }
  35. summary() {
  36. "${command}" -c "${BURP_CONFIG}" -a S
  37. }