Class: Specinfra::Command::Solaris::Base::Service
- Inherits:
-
Base::Service
- Object
- Base
- Base::Service
- Specinfra::Command::Solaris::Base::Service
- Defined in:
- lib/specinfra/command/solaris/base/service.rb
Direct Known Subclasses
Class Method Summary collapse
- .check_has_property(svc, property) ⇒ Object
- .check_is_enabled(service, level = nil) ⇒ Object
- .check_is_running(service) ⇒ Object
- .get_property(service) ⇒ Object
Methods included from Module::Service::God
Methods included from Module::Service::Monit
Methods included from Module::Service::Runit
#check_is_enabled_under_runit, #check_is_running_under_runit, #disable_under_runit, #enable_under_runit, #reload_under_runit, #restart_under_runit, #start_under_runit, #stop_under_runit
Methods included from Module::Service::Upstart
#check_is_running_under_upstart
Methods included from Module::Service::Supervisor
#check_is_running_under_supervisor
Methods included from Module::Service::Daemontools
#check_is_enabled_under_daemontools, #check_is_running_under_daemontools, #disable_under_daemontools, #enable_under_daemontools, #reload_under_daemontools, #restart_under_daemontools, #start_under_daemontools, #stop_under_daemontools
Methods included from Module::Service::Systemd
#check_is_enabled_under_systemd, #check_is_running_under_systemd, #disable_under_systemd, #enable_under_systemd, #reload_under_systemd, #restart_under_systemd, #start_under_systemd, #stop_under_systemd
Methods included from Module::Service::Init
#check_is_enabled_under_init, #check_is_running_under_init, #disable_under_init, #enable_under_init, #reload_under_init, #restart_under_init, #start_under_init, #stop_under_init
Methods included from Module::Service::Delegator
Methods inherited from Base
Class Method Details
.check_has_property(svc, property) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/specinfra/command/solaris/base/service.rb', line 11 def check_has_property(svc, property) commands = [] property.sort.each do |key, value| regexp = "^#{value}$" commands << "svcprop -p #{escape(key)} #{escape(svc)} | grep -- #{escape(regexp)}" end commands.join(' && ') end |
.check_is_enabled(service, level = nil) ⇒ Object
3 4 5 |
# File 'lib/specinfra/command/solaris/base/service.rb', line 3 def check_is_enabled(service, level=nil) "svcs -l #{escape(service)} 2> /dev/null | egrep '^enabled *true$'" end |
.check_is_running(service) ⇒ Object
7 8 9 |
# File 'lib/specinfra/command/solaris/base/service.rb', line 7 def check_is_running(service) "svcs -H -o state #{escape(service)} 2> /dev/null | egrep '^online$'" end |
.get_property(service) ⇒ Object
20 21 22 |
# File 'lib/specinfra/command/solaris/base/service.rb', line 20 def get_property(service) "svcprop -a #{escape(service)}" end |