Class: PoiseService::ServiceProviders::Systemd
- Includes:
- Chef::Mixin::ShellOut
- Defined in:
- lib/poise_service/service_providers/systemd.rb
Overview
Instance Method Summary collapse
Methods inherited from Base
#action_disable, #action_enable, #action_reload, #action_restart, #action_start, #action_stop, service_resource_hints
Instance Method Details
#pid ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'lib/poise_service/service_providers/systemd.rb', line 45 def pid cmd = shell_out(%w{systemctl status} + [new_resource.service_name]) if !cmd.error? && cmd.stdout.include?('Active: active (running)') && md = cmd.stdout.match(/Main PID: (\d+)/) md[1].to_i else nil end end |