ntp::default - apparmor
Hello Ben, a big fan of your book and have successfully built servers in the past using the book. But the past couple of days have been pretty bad. Not sure exactly what the issue is. Here's where 'bundle exec knife solo bootstrap root@
* execute[restart-monit] action run
- execute monit reload
* execute[restart-monit] action nothing (skipped due to action :nothing)
Recipe: ntp::apparmor
* service[apparmor] action restart
================================================================================
Error executing action `restart` on resource 'service[apparmor]'
================================================================================
Errno::ENOENT
-------------
No such file or directory - /etc/init.d/apparmor stop
Resource Declaration:
---------------------
# In /root/chef-solo/cookbooks-2/ntp/recipes/apparmor.rb
20: service 'apparmor' do
21: action :nothing
22: end
23:
Compiled Resource:
------------------
# Declared in /root/chef-solo/cookbooks-2/ntp/recipes/apparmor.rb:20:in `from_file'
service("apparmor") do
action [:nothing]
supports {:restart=>false, :reload=>false, :status=>false}
retries 0
retry_delay 2
guard_interpreter :default
service_name "apparmor"
pattern "apparmor"
cookbook_name :ntp
recipe_name "apparmor"
end
Recipe: ntp::default
* service[ntp] action restart
- restart service service[ntp]
Recipe: fail2ban::default
* service[fail2ban] action restart
- restart service service[fail2ban]
Recipe: nginx::default
* service[nginx] action reload
- reload service service[nginx]
Recipe: memcached::default
* service[memcached] action restart
- restart service service[memcached]
Recipe: mongodb::default
* service[mongod] action restart
- restart service service[mongod]
Running handlers:
[2015-03-25T21:32:01+00:00] ERROR: Running exception handlers
Running handlers complete
[2015-03-25T21:32:01+00:00] ERROR: Exception handlers complete
[2015-03-25T21:32:01+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
Chef Client failed. 181 resources updated in 707.495412476 seconds
[2015-03-25T21:32:01+00:00] ERROR: service[apparmor] (ntp::apparmor line 20) had an error: Errno::ENOENT: No such file or directory - /etc/init.d/apparmor stop
[2015-03-25T21:32:01+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
ERROR: RuntimeError: chef-solo failed. See output above.
Could you please help?
Interesting, not one I've seen before. My initial guess would be that apparmour is now configured to use only the new service x restart etc logic and that's why it's failing. But that really is just a guess. I'll spin up a Linode over the weekend and try to replicate then update this thread. And many thanks for the kind words about the book, I'm glad it's useful!
Thanks for looking into it Ben, for now, I am just moving forward without the 'ntp' recipe, but would love to incorporate it at some point.
I am facing also facing same problem.
This is now fixed on master. The solution was updating the ntp cookbook which you can do on an existing project with berks update ntp. Thanks for reporting this one! Cheers, Ben.