Skip to content

Commit

Permalink
Fix spamassassin service name for Debian 12
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Jun 20, 2023
1 parent 50a65ff commit 9db244a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cookbooks/spamassassin/recipes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@

package "spamassassin"

service "spamassassin" do
service_name = if platform?("debian")
"spamd"
else
"spamassassin"
end

service service_name do
action [:enable, :start]
supports :status => true, :restart => true, :reload => true
end
Expand All @@ -35,7 +41,7 @@
owner "root"
group "root"
mode "644"
notifies :restart, "service[spamassassin]"
notifies :restart, "service[#{service_name}]"
end

trusted_networks = node[:exim][:relay_from_hosts]
Expand All @@ -54,5 +60,5 @@
group "root"
mode "644"
variables :trusted_networks => trusted_networks.sort
notifies :restart, "service[spamassassin]"
notifies :restart, "service[#{service_name}]"
end

0 comments on commit 9db244a

Please sign in to comment.