diff --git a/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java b/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java index d351a9d4ea2..9c3c2fdda2b 100644 --- a/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java +++ b/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java @@ -216,15 +216,6 @@ public class Bootstrap { // fail if using broken version JVMCheck.check(); - bootstrap.setup(true, settings, environment); - - stage = "Startup"; - bootstrap.start(); - - if (!foreground) { - closeSysError(); - } - keepAliveLatch = new CountDownLatch(1); // keep this thread alive (non daemon thread) until we shutdown Runtime.getRuntime().addShutdownHook(new Thread() { @@ -234,6 +225,15 @@ public class Bootstrap { } }); + bootstrap.setup(true, settings, environment); + + stage = "Startup"; + bootstrap.start(); + + if (!foreground) { + closeSysError(); + } + keepAliveThread = new Thread(new Runnable() { @Override public void run() { diff --git a/src/main/resources/org/elasticsearch/bootstrap/security.policy b/src/main/resources/org/elasticsearch/bootstrap/security.policy index 993868c18b3..49cba2099ce 100644 --- a/src/main/resources/org/elasticsearch/bootstrap/security.policy +++ b/src/main/resources/org/elasticsearch/bootstrap/security.policy @@ -66,9 +66,6 @@ grant { // needed by BootStrap, etc permission java.lang.RuntimePermission "exitVM.*"; - // needed by RandomizedTest.globalTempDir() - permission java.lang.RuntimePermission "shutdownHooks"; - // needed by PluginManager permission java.lang.RuntimePermission "setFactory";