From 5a701c1f9f48fd68e65aa0c53fe5ccb36b7210d7 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Mon, 4 May 2015 10:18:09 -0400 Subject: [PATCH] remove shutdownHooks permission --- .../org/elasticsearch/bootstrap/Bootstrap.java | 18 +++++++++--------- .../elasticsearch/bootstrap/security.policy | 3 --- 2 files changed, 9 insertions(+), 12 deletions(-) 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";