chef-cookbooks / auditd

Install and configure user mode auditd tools
Apache License 2.0
34 stars 40 forks source link

Failed to restart auditd.service: Operation refused, unit auditd.service may be requested by dependency only. #19

Closed polliard-jmfe closed 8 years ago

polliard-jmfe commented 8 years ago

Running this on a RHEL 72 system from a wrapper cookbook. The rules get put in place and the package gets added but I get the following when the service is manipulated.

Recipe: auditd::default

       ================================================================================
       Error executing action `restart` on resource 'service[auditd]'
       ================================================================================

       Mixlib::ShellOut::ShellCommandFailed
       ------------------------------------
       Expected process to exit with [0], but received '4'
       ---- Begin output of /bin/systemctl restart auditd ----
       STDOUT:
       STDERR: Failed to restart auditd.service: Operation refused, unit auditd.service may be requested by dependency only.
       ---- End output of /bin/systemctl restart auditd ----
       Ran /bin/systemctl restart auditd returned 4

       Resource Declaration:
       ---------------------
       # In /tmp/kitchen/cache/cookbooks/auditd/recipes/default.rb

        27: service "auditd" do
        28:   supports [ :restart, :reload, :status ]
        29:   action :enable
        30: end

       Compiled Resource:
       ------------------
       # Declared in /tmp/kitchen/cache/cookbooks/auditd/recipes/default.rb:27:in `from_file'

       service("auditd") do
         action [:enable]
         supports {:restart=>true, :reload=>true, :status=>true}
         retries 0
         retry_delay 2
         default_guard_interpreter :default
         service_name "auditd"
         enabled true
         running true
         pattern "auditd"
         declared_type :service
         cookbook_name "auditd"
         recipe_name "default"
       end

Appears that perhaps this was not intended for use with RHEL 7 (upstart)?

polliard-jmfe commented 8 years ago

I found that with the following resource declaration:

include_recipe 'auditd::default'

include_recipe 'auditd::rules'

If I run

include_recipe 'auditd::default'

include_recipe 'auditd::rules'

Then I get the same failure.

slyness commented 8 years ago

resolved with PR #22 .. This will ship with release 0.1.8.