[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.
This commit is contained in:
jtimberman 2012-04-09 12:35:38 -06:00
parent 002bcb8029
commit 251f37a272

View File

@ -22,15 +22,13 @@ package "postfix" do
action :install
end
case node[:platform]
when "ubuntu", "debian"
service "postfix" do
service "postfix" do
supports :status => true, :restart => true, :reload => true
action :enable
end
when "redhat", "centos"
service "postfix" do
action :nothing
end
end
case node[:platform]
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