zuazo/spamassassin-cookbook

View on GitHub
templates/default/sysconfig_spamassassin.erb

Summary

Maintainability
Test Coverage
<%

if (%w(--daemonize -d) & @options).empty?
  # Avoid daemonize with systemd and "Type=forking" enabled
  systemd_config = '/usr/lib/systemd/system/spamassassin.service'
  unless ::File.exist?(systemd_config) &&
         !Mixlib::ShellOut.new("grep -q '^\s*Type=forking' '#{systemd_config}'")
    @options = @options + %w(--daemonize)
  end
end

-%>
# Generated by Chef

# Options to spamd
SPAMDOPTIONS="<%= @options.join(' ') %>"
SPAMD_PID="<%= @pidfile %>"
<% unless @nice.nil? -%>
NICELEVEL="<%= @nice %>"
<% end -%>