Class: SrcMstr
- Inherits:
-
ServiceManager
- Object
- ServiceManager
- SrcMstr
- Defined in:
- lib/resources/service.rb
Overview
AIX services
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from ServiceManager
Instance Method Summary collapse
Methods inherited from ServiceManager
Constructor Details
This class inherits a constructor from ServiceManager
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
162 163 164 |
# File 'lib/resources/service.rb', line 162 def name @name end |
Instance Method Details
#enabled? ⇒ Boolean
185 186 187 |
# File 'lib/resources/service.rb', line 185 def enabled? enabled_rc_tcpip? || enabled_inittab? end |
#info(service_name) ⇒ Object
164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
# File 'lib/resources/service.rb', line 164 def info(service_name) @name = service_name running = status? return nil if running.nil? { name: service_name, description: nil, installed: true, running: running, enabled: enabled?, type: 'srcmstr', } end |
#status? ⇒ Boolean
179 180 181 182 183 |
# File 'lib/resources/service.rb', line 179 def status? status_cmd = inspec.command("lssrc -s #{@name}") return nil if status_cmd.exit_status.to_i != 0 status_cmd.stdout.split(/\n/).last.chomp =~ /active$/ ? true : false end |