Mercurial > hg > thermostat-ng > agent
changeset 2432:b36e89aa7070
Get PID when starting storage and don't wait if process doesn't start successfully
Reviewed-by: jerboaa
Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2016-August/020693.html
author | Jie Kang <jkang@redhat.com> |
---|---|
date | Fri, 26 Aug 2016 11:48:51 -0400 |
parents | e477b15804cb |
children | 2689d87205f2 |
files | storage/cli/src/main/java/com/redhat/thermostat/storage/cli/internal/MongoProcessRunner.java |
diffstat | 1 files changed, 6 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/storage/cli/src/main/java/com/redhat/thermostat/storage/cli/internal/MongoProcessRunner.java Thu Aug 25 12:36:07 2016 -0400 +++ b/storage/cli/src/main/java/com/redhat/thermostat/storage/cli/internal/MongoProcessRunner.java Fri Aug 26 11:48:51 2016 -0400 @@ -46,13 +46,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.TimeoutException; import java.util.logging.Level; import java.util.logging.Logger; @@ -203,9 +196,13 @@ throw new ApplicationException(message.getContents(), ae); } - waitForLogFile(getStartString(dbVersion)); + if (status == 0) { + waitForLogFile(getStartString(dbVersion)); + /** + * This checkPid() call will also set the variable pid used in the following display(...) call + */ + checkPid(); - if (status == 0) { display(translator.localize(LocaleResources.SERVER_LISTENING_ON, configuration.getDBConnectionString())); display(translator.localize(LocaleResources.LOG_FILE_AT, configuration.getLogFile().toString())); display(translator.localize(LocaleResources.PID_IS, String.valueOf(pid)));