Class: Flamingo::Daemon::ChildProcess
- Inherits:
-
Object
- Object
- Flamingo::Daemon::ChildProcess
show all
- Includes:
- TrapKeeper
- Defined in:
- lib/flamingo/daemon/child_process.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from TrapKeeper
trap
Instance Attribute Details
#pid ⇒ Object
Returns the value of attribute pid.
8
9
10
|
# File 'lib/flamingo/daemon/child_process.rb', line 8
def pid
@pid
end
|
Instance Method Details
#kill(sig) ⇒ Object
Also known as:
signal
10
11
12
|
# File 'lib/flamingo/daemon/child_process.rb', line 10
def kill(sig)
Process.kill(sig,pid)
end
|
#running? ⇒ Boolean
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/flamingo/daemon/child_process.rb', line 15
def running?
Process.kill(0, pid)
return true
rescue Errno::ESRCH
return false
rescue ::Exception
return true
end
|
#start ⇒ Object
26
27
28
29
30
31
|
# File 'lib/flamingo/daemon/child_process.rb', line 26
def start
self.pid = fork do
post_fork
run
end
end
|