rc.pound 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc
  2. ##
  3. ## rc.pound -- Run-Commands
  4. ##
  5. %config
  6. pound_enable="$openpkg_rc_def"
  7. pound_log_prolog="true"
  8. pound_log_epilog="true"
  9. pound_log_numfiles="10"
  10. pound_log_minsize="1M"
  11. pound_log_complevel="9"
  12. %common
  13. pound_pidfile="@l_prefix@/var/pound/pound.pid"
  14. pound_signal () {
  15. [ -f $pound_pidfile ] && kill -$1 `cat $pound_pidfile`
  16. }
  17. %status -u @l_susr@ -o
  18. pound_usable="unknown"
  19. pound_active="no"
  20. rcService pound enable yes && \
  21. pound_signal 0 && pound_active="yes"
  22. echo "pound_enable=\"$pound_enable\""
  23. echo "pound_usable=\"$pound_usable\""
  24. echo "pound_active=\"$pound_active\""
  25. %start -u @l_susr@
  26. rcService pound enable yes || exit 0
  27. rcService pound active yes && exit 0
  28. @l_prefix@/sbin/pound
  29. %stop -u @l_susr@
  30. rcService pound enable yes || exit 0
  31. rcService pound active no && exit 0
  32. pound_signal TERM
  33. sleep 1
  34. %restart -u @l_susr@
  35. rcService pound enable yes || exit 0
  36. rcService pound active no && exit 0
  37. rc pound stop start
  38. %daily -u @l_susr@
  39. rcService pound enable yes || exit 0
  40. shtool rotate -f \
  41. -n ${pound_log_numfiles} -s ${pound_log_minsize} -d \
  42. -z ${pound_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \
  43. -P "${pound_log_prolog}" \
  44. -E "${pound_log_epilog}" \
  45. @l_prefix@/var/pound/pound.log