Class: Luban::Deployment::Packages::Nginx::Controller

Inherits:
Service::Controller
  • Object
show all
Includes:
Commands
Defined in:
lib/luban/deployment/packages/nginx/controller.rb

Defined Under Namespace

Modules: Commands

Instance Method Summary collapse

Methods included from Commands

#bin_path, included, #nginx_command, #process_pattern, #start_command, #stop_command

Instance Method Details

#quit_processObject



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/luban/deployment/packages/nginx/controller.rb', line 40

def quit_process
  if process_stopped?
    update_result "Skipped! Already stopped #{package_full_name}", status: :skipped
    return
  end

  unmonitor_process
  output = quit_process!
  if check_until { process_stopped? }
    update_result "Gracefully stop #{package_full_name}: [OK] #{output}"
  else
    remove_orphaned_pid_file
    update_result "Gracefully stop #{package_full_name}: [FAILED] #{output}",
                  status: :failed, level: :error
  end
end