lib/flydata/command/helper.rb in flydata-0.8.1 vs lib/flydata/command/helper.rb in flydata-0.8.2
- old
+ new
@@ -64,13 +64,15 @@
end
def restart(options = {})
if running?
log_info_stdout("Restarting Helper.", {}, options)
- run_command(stop_cmd, options)
+ unless run_command(stop_cmd, options)
+ raise "[error] Failed to stop helper process. Please run 'flydata helper:restart' after checking the process."
+ end
end
- raw_start
+ start(options)
end
def reload(options = {})
if running?
log_info_stdout("Reloading Helper.", {}, options)
@@ -117,11 +119,11 @@
#{kill_cmd}
i=0
while #{running_cmd}; do
sleep 1.0
if [ $i -gt 10 ]; then # 10sec
- echo "Timeout warning: It failed to stop within 10 seconds. The process will be killed with SIGKILL."
- kill -9 -$(ps --pid `cat #{@helper_config.helper_pid_path}` --no-heading -o "%r" | tr -d ' ')
+ echo "Timeout warning: It failed to stop within 10 seconds. The process will be left." 1>&2
+ exit 1
else
i=`expr $i + 1`
fi
done
rm #{@helper_config.helper_pid_path}