Class: RegenwolkeAutons::NginxAuton
- Inherits:
-
Object
- Object
- RegenwolkeAutons::NginxAuton
- Includes:
- StructureMapper::Hash
- Defined in:
- lib/regenwolke_autons/nginx_auton.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
Instance Method Summary collapse
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
14 15 16 |
# File 'lib/regenwolke_autons/nginx_auton.rb', line 14 def context @context end |
Instance Method Details
#start ⇒ Object
16 17 18 19 |
# File 'lib/regenwolke_autons/nginx_auton.rb', line 16 def start context.schedule_step(:start_nginx_if_not_running) context.schedule_repeating_delayed_step 10, 10, :start_nginx_if_not_running end |
#start_nginx ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/regenwolke_autons/nginx_auton.rb', line 21 def start_nginx create_config cp = ChildProcess.build('nginx', '-p', '.', '-c', 'nginx.config') cp.detach = true cp.start self.pid = cp.pid end |
#start_nginx_if_not_running ⇒ Object
30 31 32 |
# File 'lib/regenwolke_autons/nginx_auton.rb', line 30 def start_nginx_if_not_running context.schedule_step(:start_nginx) unless nginx_process_exist? end |