sous-chefs/apparmor

Default recipe throws error on ubuntu 15.04

Closed this issue · 1 comments

its invoking wrong systemd command to enable apparmor service. Instead of

 /bin/systemctl enable apparmor

the recipe needs to execute:

 /bin/systemctl enable apparmor.service

stacktrace:

Recipe: apparmor::default
  * apt_package[apparmor] action install (up to date)
  * service[apparmor] action start (up to date)
  * service[apparmor] action enable

    ================================================================================
    Error executing action `enable` on resource 'service[apparmor]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of /bin/systemctl enable apparmor ----
    STDOUT: 
    STDERR: Synchronizing state for apparmor.service with sysvinit using update-rc.d...
    Executing /usr/sbin/update-rc.d apparmor defaults
    Executing /usr/sbin/update-rc.d apparmor enable
    Failed to execute operation: No such file or directory
    ---- End output of /bin/systemctl enable apparmor ----
    Ran /bin/systemctl enable apparmor returned 1

    Resource Declaration:
    ---------------------
    # In /var/chef/cache/cookbooks/apparmor/recipes/default.rb

     30:   service 'apparmor' do
     31:     action       actions
     32:     supports     [:restart, :reload, :status]
     33:     stop_command '/usr/sbin/service apparmor teardown'
     34:   end
     35: end

    Compiled Resource:
    ------------------
    # Declared in /var/chef/cache/cookbooks/apparmor/recipes/default.rb:30:in `from_file'

    service("apparmor") do
      action [:start, :enable]
      supports {:restart=>true, :reload=>true, :status=>true}
      retries 0
      retry_delay 2
      default_guard_interpreter :default
      service_name "apparmor"
      running true
      pattern "apparmor"
      stop_command "/usr/sbin/service apparmor teardown"
      declared_type :service
      cookbook_name "apparmor"
      recipe_name "default"
    end


Running handlers:
[2015-07-13T00:32:08-07:00] ERROR: Running exception handlers
Running handlers complete
tas50 commented

I just added 15.04 to the test kitchen config and it's running without any issues on Chef 12.5.1 with the 2.0 apparmor cookbook. I'm going to close this out unless you're still having the problem with the new stuff.