diff --git a/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java b/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java index f69a9c35409..55d3712af71 100644 --- a/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java +++ b/src/main/java/org/elasticsearch/bootstrap/Bootstrap.java @@ -93,12 +93,8 @@ public class Bootstrap { } private void setupSecurity(Settings settings, Environment environment) throws Exception { - ESLogger logger = Loggers.getLogger(Bootstrap.class); if (settings.getAsBoolean("security.enabled", true)) { Security.configure(environment); - logger.info("security enabled"); - } else { - logger.warn("security disabled"); } } diff --git a/src/main/java/org/elasticsearch/bootstrap/Security.java b/src/main/java/org/elasticsearch/bootstrap/Security.java index ac2bf6b0913..0a2bfec614e 100644 --- a/src/main/java/org/elasticsearch/bootstrap/Security.java +++ b/src/main/java/org/elasticsearch/bootstrap/Security.java @@ -19,6 +19,7 @@ package org.elasticsearch.bootstrap; +import org.apache.lucene.util.IOUtils; import org.apache.lucene.util.StringHelper; import org.elasticsearch.common.logging.Loggers; import org.elasticsearch.env.Environment; @@ -53,11 +54,7 @@ class Security { Path newConfig = processTemplate(environment.configFile().resolve("security.policy"), environment); System.setProperty("java.security.policy", newConfig.toString()); System.setSecurityManager(new SecurityManager()); - try { - Files.delete(newConfig); - } catch (Exception e) { - Loggers.getLogger(Security.class).warn("unable to remove temporary file: " + newConfig, e); - } + IOUtils.deleteFilesIgnoringExceptions(newConfig); // TODO: maybe log something if it fails? } // package-private for testing