Class: Specinfra::Command::Freebsd::Base::Process

Inherits:
Base::Process show all
Defined in:
lib/specinfra/command/freebsd/base/process.rb

Class Method Summary collapse

Methods inherited from Base

create, escape

Class Method Details

.check_count(process, count) ⇒ Object



15
16
17
# File 'lib/specinfra/command/freebsd/base/process.rb', line 15

def check_count(process,count)
  "test `pgrep #{escape(process)} | wc -l` -eq #{escape(count)}"
end

.check_is_running(process) ⇒ Object



11
12
13
# File 'lib/specinfra/command/freebsd/base/process.rb', line 11

def check_is_running(process)
  "pgrep -q #{escape(process)}"
end

.count(process) ⇒ Object



7
8
9
# File 'lib/specinfra/command/freebsd/base/process.rb', line 7

def count(process)
  "pgrep #{escape(process)} | wc -l"
end

.get(process, opts) ⇒ Object



3
4
5
# File 'lib/specinfra/command/freebsd/base/process.rb', line 3

def get(process, opts)
  "ps -p `pgrep -xn #{escape(process)}` -o #{opts[:format]}"
end