Method: Inspec::Resources::Upstart#info
- Defined in:
- lib/resources/service.rb
#info(service_name) ⇒ Object
344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 |
# File 'lib/resources/service.rb', line 344 def info(service_name) # get the status of upstart service status = inspec.command("#{service_ctl} status #{service_name}") # fallback for systemv services, those are not handled via `initctl` return SysV.new(inspec).info(service_name) if status.exit_status.to_i != 0 || status.stdout == '' # @see: http://upstart.ubuntu.com/cookbook/#job-states # grep for running to indicate the service is there running = !status.stdout[%r{start/running}].nil? { name: service_name, description: nil, installed: true, running: running, enabled: info_enabled(service_name), type: 'upstart', } end |