From 251f37a272ab059fe0116088719c68d1b2408aac Mon Sep 17 00:00:00 2001 From: jtimberman Date: Mon, 9 Apr 2012 12:35:38 -0600 Subject: [PATCH] [COOK-668] - rearrange postfix service * Supported platforms (Debian and RHEL families) have status, reload and restart commands in their init scripts, we can specify those as supported by the service. * the service should be enabled at boot time on all platforms * Make sure that the service gets started at the end of the recipe since it wouldn't be started, only restarted, elsewhere. --- recipes/default.rb | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/recipes/default.rb b/recipes/default.rb index 6d88b45..ef00f91 100644 --- a/recipes/default.rb +++ b/recipes/default.rb @@ -22,15 +22,13 @@ package "postfix" do action :install end +service "postfix" do + supports :status => true, :restart => true, :reload => true + action :enable +end + case node[:platform] -when "ubuntu", "debian" - service "postfix" do - action :enable - end -when "redhat", "centos" - service "postfix" do - action :nothing - end +when "redhat", "centos", "amazon", "scientific" service "sendmail" do action :nothing end @@ -51,3 +49,7 @@ end notifies :restart, resources(:service => "postfix") end end + +service "postfix" do + action :start +end