Class: Inspec::Resources::Svcs
- Inherits:
 - 
      ServiceManager
      
        
- Object
 - ServiceManager
 - Inspec::Resources::Svcs
 
 
- Defined in:
 - lib/resources/service.rb
 
Overview
Solaris services
Instance Attribute Summary
Attributes inherited from ServiceManager
Instance Method Summary collapse
- #info(service_name) ⇒ Object
 - 
  
    
      #initialize(service_name, service_ctl = nil)  ⇒ Svcs 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Svcs.
 
Constructor Details
#initialize(service_name, service_ctl = nil) ⇒ Svcs
Returns a new instance of Svcs.
      620 621 622 623  | 
    
      # File 'lib/resources/service.rb', line 620 def initialize(service_name, service_ctl = nil) @service_ctl = service_ctl || 'svcs' super end  | 
  
Instance Method Details
#info(service_name) ⇒ Object
      625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648  | 
    
      # File 'lib/resources/service.rb', line 625 def info(service_name) # get the status of runit service cmd = inspec.command("#{service_ctl} -l #{service_name}") return nil if cmd.exit_status != 0 params = SimpleConfig.new( cmd.stdout.chomp, assignment_re: /^(\w+)\s*(.*)$/, multiple_values: false, ).params installed = cmd.exit_status == 0 running = installed && (params['state'] == 'online') enabled = installed && (params['enabled'] == 'true') { name: service_name, description: params['name'], installed: installed, running: running, enabled: enabled, type: 'svcs', } end  |