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.

rspamd.sh.in 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #!/bin/sh
  2. #
  3. # $Id$
  4. #
  5. # PROVIDE: rspamd
  6. # REQUIRE: LOGIN
  7. # KEYWORD: shutdown
  8. #
  9. # Add the following line to /etc/rc.conf to enable countd:
  10. # rspamd (bool): Set to "NO" by default.
  11. # Set it to "YES" to enable rspamd.
  12. . /etc/rc.subr
  13. name="rspamd"
  14. rcvar=`set_rcvar`
  15. procname="@CMAKE_INSTALL_PREFIX@/bin/rspamd"
  16. restart_precmd="rspamd_checkconfig"
  17. reload_precmd="rspamd_checkconfig"
  18. configtest_cmd="rspamd_checkconfig"
  19. reopenlog_cmd="reopenlog_cmd"
  20. load_rc_config $name
  21. : ${rspamd_enable="NO"}
  22. : ${rspamd_pidfile="/var/run/rspamd/rspamd.pid"}
  23. : ${rspamd_run_user="@RSPAMD_USER@"}
  24. : ${rspamd_run_group="@RSPAMD_GROUP@"}
  25. pidfile="$rspamd_pidfile"
  26. stop_postcmd="rm -f $rspamd_pidfile"
  27. rspamd_checkconfig()
  28. {
  29. echo "Performing sanity check on rspamd configuration:"
  30. eval ${command} -t
  31. }
  32. reopenlog_cmd()
  33. {
  34. pkill -USR1 -F $rspamd_pidfile
  35. }
  36. extra_commands="reload configtest reopenlog"
  37. sig_reload="HUP"
  38. command="$procname"
  39. command_args="-u ${rspamd_run_user} -g ${rspamd_run_group} -c @CMAKE_INSTALL_PREFIX@/etc/rspamd.xml"
  40. run_rc_command "$1"