{"action":"created","issue":{"url":"https://api.github.com/repos/svanzoest-cookbooks/apache2/issues/259","labels_url":"https://api.github.com/repos/svanzoest-cookbooks/apache2/issues/259/labels{/name}","comments_url":"https://api.github.com/repos/svanzoest-cookbooks/apache2/issues/259/comments","events_url":"https://api.github.com/repos/svanzoest-cookbooks/apache2/issues/259/events","html_url":"https://github.com/svanzoest-cookbooks/apache2/issues/259","id":45357758,"number":259,"title":"mod_unique_id cause Apache to fail restart on first coverge","user":{"login":"niven01","id":3418544,"avatar_url":"https://avatars.githubusercontent.com/u/3418544?v=3","gravatar_id":"","url":"https://api.github.com/users/niven01","html_url":"https://github.com/niven01","followers_url":"https://api.github.com/users/niven01/followers","following_url":"https://api.github.com/users/niven01/following{/other_user}","gists_url":"https://api.github.com/users/niven01/gists{/gist_id}","starred_url":"https://api.github.com/users/niven01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niven01/subscriptions","organizations_url":"https://api.github.com/users/niven01/orgs","repos_url":"https://api.github.com/users/niven01/repos","events_url":"https://api.github.com/users/niven01/events{/privacy}","received_events_url":"https://api.github.com/users/niven01/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/svanzoest-cookbooks/apache2/labels/apache-2.2","name":"apache-2.2","color":"fbca04"},{"url":"https://api.github.com/repos/svanzoest-cookbooks/apache2/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2014-10-09T11:59:53Z","updated_at":"2015-05-08T01:46:34Z","closed_at":null,"body":"Hello,\r\n\r\nI've encountered a problem after introducing unique_id where Apache fails to restart.\r\nThe work around at this moment is a `killall httpd` and re run chef-client\r\n\r\nThis can be reproduced in test-kitchen by just including two recipes:  \r\n\r\n-\r\n    name: upstream_apache\r\n    run_list:\r\n      - \"recipe[apache2]\"\r\n      - \"recipe[apache2::mod_unique_id]\"\r\n\r\nThe behavior seen is that httpd is stopped but only the master process is killed. There are a bunch of httpd orphans still sitting there listening on 80 and 443\r\n\r\nWhen Apache tries to start it fails as ports are already in use.\r\n\r\nEvery now and then it will succeed which suggests to me this maybe a timing issue and that httpd start is happening before the stop has completed. \r\n\r\n\r\nError:\r\n\r\n```      ================================================================================\r\n           Error executing action `restart` on resource 'service[apache2]'\r\n           \r\n       ================================================================================\r\n           \r\n           Mixlib::ShellOut::ShellCommandFailed\r\n           ------------------------------------\r\n           Expected process to exit with [0], but received '1'\r\n           ---- Begin output of /sbin/service httpd restart ----\r\n           STDOUT: Stopping httpd: [  OK  ]\r\n           Starting httpd: [FAILED]\r\n           STDERR: [Thu Oct 09 11:56:26 2014] [warn] NameVirtualHost *:80 has no VirtualHosts\r\n           (98)Address already in use: make_sock: could not bind to address [::]:80\r\n           (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80\r\n           \r\n       no listening sockets available, shutting down\r\n           Unable to open logs\r\n           ---- End output of /sbin/service httpd restart ----\r\n           Ran /sbin/service httpd restart returned 1\r\n           \r\n           \r\n       Resource Declaration:\r\n           ---------------------\r\n           # In /tmp/kitchen/cache/cookbooks/apache2/recipes/default.rb\r\n           \r\n            24: service 'apache2' do\r\n            25:   service_name node['apache']['package']\r\n            26:   case node['platform_family']\r\n            27:   when 'rhel'\r\n            28:     reload_command '/sbin/service httpd graceful'\r\n            29:   when 'debian'\r\n            30:     provider Chef::Provider::Service::Debian\r\n            31:   when 'arch'\r\n            32:     service_name 'httpd'\r\n            33:   end\r\n            34:   supports [:start, :restart, :reload, :status]\r\n           \r\n           Compiled Resource:\r\n           ------------------\r\n           # Declared in /tmp/kitchen/cache/cookbooks/apache2/recipes/default.rb:24:in `from_file'\r\n           \r\n           service(\"apache2\") do\r\n           \r\n         action [:enable, :start]\r\n             updated true\r\n             supports {:restart=>true, :reload=>true, :status=>true, :start=>true}\r\n             retries 0\r\n             retry_delay 2\r\n             guard_interpreter :default\r\n             service_name \"httpd\"\r\n             enabled true\r\n             running true\r\n             pattern \"apache2\"\r\n             reload_command \"/sbin/service httpd graceful\"\r\n             cookbook_name \"apache2\"\r\n             recipe_name \"default\"\r\n             only_if \"/usr/sbin/httpd -t\"\r\n           end\r\n``` "},"comment":{"url":"https://api.github.com/repos/svanzoest-cookbooks/apache2/issues/comments/100069570","html_url":"https://github.com/svanzoest-cookbooks/apache2/issues/259#issuecomment-100069570","issue_url":"https://api.github.com/repos/svanzoest-cookbooks/apache2/issues/259","id":100069570,"user":{"login":"svanzoest","id":14098,"avatar_url":"https://avatars.githubusercontent.com/u/14098?v=3","gravatar_id":"","url":"https://api.github.com/users/svanzoest","html_url":"https://github.com/svanzoest","followers_url":"https://api.github.com/users/svanzoest/followers","following_url":"https://api.github.com/users/svanzoest/following{/other_user}","gists_url":"https://api.github.com/users/svanzoest/gists{/gist_id}","starred_url":"https://api.github.com/users/svanzoest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svanzoest/subscriptions","organizations_url":"https://api.github.com/users/svanzoest/orgs","repos_url":"https://api.github.com/users/svanzoest/repos","events_url":"https://api.github.com/users/svanzoest/events{/privacy}","received_events_url":"https://api.github.com/users/svanzoest/received_events","type":"User","site_admin":false},"created_at":"2015-05-08T01:46:34Z","updated_at":"2015-05-08T01:46:34Z","body":"This seems to be an issue with the 2.2 init scripts. We did remove a `&& sleep 1` from service resource in the cookbook (https://github.com/svanzoest-cookbooks/apache2/commit/f0fc1ce490a5fccb10915c1e5088a4caaa352db5)  seems like this showed up when we removed it?\r\n\r\nWe clearly do not need it on the newer platforms, but it seems like `mod_security` and `mod_unique_id` cause things to take longer in a way that the init scripts do not handle gracefully. When tried to look back to see what was the reasoning for the sleeps to get added, but there was nothing in the commits that indicated a reason. I guess we found two. ;-)"}}