From d3febce937e8fb2d91ca9e2a19a443adab5e72fc Mon Sep 17 00:00:00 2001 From: Kyuden Date: Mon, 6 Oct 2014 07:52:17 +0900 Subject: [PATCH] Cleanly exits from commands. --- lib/fluentd-ui/command.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/fluentd-ui/command.rb b/lib/fluentd-ui/command.rb index 3c10ec5..8dff8a2 100644 --- a/lib/fluentd-ui/command.rb +++ b/lib/fluentd-ui/command.rb @@ -8,6 +8,7 @@ module FluentdUI option :pidfile, type: :string, default: File.expand_path('tmp/fluentd-ui.pid', ROOT) option :daemonize, type: :boolean, default: false def start + trap(:INT) { puts "\nStopping..." } system(*%W(bundle exec rackup #{options[:daemonize] ? "-D" : ""} --pid #{options[:pidfile]} -p #{options[:port]} -E production #{ROOT}/config.ru)) end @@ -40,6 +41,7 @@ module FluentdUI install dependency gems DESC def setup + trap(:INT) { puts "\nStopping..." } system(*%W(bundle install)) end