Issue Details (XML | Word | Printable)

Key: COOK-126
Type: Improvement Improvement
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Joshua Timberman
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Chef Cookbooks

update apache2 status_command

Created: 01/Jun/09 11:43 PM   Updated: 02/Jun/09 12:02 AM
Component/s: None
Affects Version/s: None
Fix Version/s: None


 Description  « Hide

The apache2 init script doesn't consistently support status argument, but the apache2ctl command does.



Sort Order: Ascending order - Click to sort in descending order
Nathaniel Brown added a comment - 02/Jun/09 12:02 AM

service "apache2" do
case node[:platform]
when "centos","redhat","fedora","suse"
service_name "httpd"

  1. If restarted/reloaded too quickly httpd has a habit of failing.
  2. This may happen with multiple recipes notifying apache to restart - like
  3. during the initial bootstrap.
    restart_command "/sbin/service httpd restart && sleep 1"
    reload_command "/sbin/service httpd reload && sleep 1"
    when "debian","ubuntu"
    service_name "apache2"
    end

case node[:platform]
when "ubuntu"
status_command "/usr/sbin/apache2ctl status" if node[:platform_version] == '8.04'
end

supports value_for_platform(
"debian" => { "4.0" => [ :restart, :reload ], "default" => [ :restart, :reload, :status ] },
"ubuntu" => { "8.04" => [ :restart, :reload ], "default" => [ :restart, :reload, :status ] },
"centos" => { "default" => [ :restart, :reload, :status ] },
"redhat" => { "default" => [ :restart, :reload, :status ] },
"fedora" => { "default" => [ :restart, :reload, :status ] },
"default" => { "default" => [:restart, :reload ] }
)

action :enable
end