lib/inspec/resources/linux_audit_system.rb
def running?
      auditctl_cmd = inspec.command("#{auditctl_utility} -s | grep pid")

      raise Inspec::Exceptions::ResourceFailed, "Executing #{auditctl_utility} -s | grep enabled failed: #{auditctl_cmd.stderr}" if auditctl_cmd.exit_status.to_i != 0

      # Sample stdout: pid 682462
      auditctl_running_status = auditctl_cmd.stdout.strip.split
      !auditctl_running_status[1].nil? && auditctl_running_status[1].to_i != 0
    end
# The be_running matcher checks if the audit daemon is running.
# A pid of 0 indicates that the audit daemon is not running.
The be_running matcher checks if the audit daemon is running.
A pid of 0 indicates that the audit daemon is not running.
The be_running matcher checks if the audit daemon is running . A pid of 0 indicates that the audit daemon is not running .
def running?
      auditctl_cmd = inspec.command("#{auditctl_utility} -s | grep pid")
      raise Inspec::Exceptions::ResourceFailed, "Executing #{auditctl_utility} -s | grep enabled failed: #{auditctl_cmd.stderr}" if auditctl_cmd.exit_status.to_i != 0
      auditctl_running_status = auditctl_cmd.stdout.strip.split
      !auditctl_running_status[1].nil? && auditctl_running_status[1].to_i != 0
    end
def running? auditctl_cmd = inspec . command ( "#{auditctl_utility} -s | grep pid" ) raise Inspec :: Exceptions :: ResourceFailed , "Executing #{auditctl_utility} -s | grep enabled failed: #{auditctl_cmd.stderr}" if auditctl_cmd . exit_status . to_i != 0 auditctl_running_status = auditctl_cmd . stdout . strip . split ! auditctl_running_status [ 1 ] . nil? && auditctl_running_status [ 1 ] . to_i != 0 end
The be_running matcher checks if the audit daemon is running.
The be_running matcher checks if the audit daemon is running .
# Sample stdout: pid 682462