From 08e35e4dbea1da5080bf5d03267b24186d5c2e28 Mon Sep 17 00:00:00 2001 From: skymeyer Date: Thu, 18 Jul 2013 14:58:20 -0700 Subject: [PATCH] Use systemd configuration file for applying limits correctly In case systemd is used, ulimit is not called (as it would be in the initscript) and has to be configured in the systemd configuration. For more information about the parameters LimitNOFILE and LimitMEMLOCK see http://www.freedesktop.org/software/systemd/man/systemd.exec.html --- src/rpm/systemd/elasticsearch.service | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rpm/systemd/elasticsearch.service b/src/rpm/systemd/elasticsearch.service index c68c5054391..740639ef74e 100644 --- a/src/rpm/systemd/elasticsearch.service +++ b/src/rpm/systemd/elasticsearch.service @@ -9,6 +9,10 @@ User=elasticsearch Group=elasticsearch PIDFile=/var/run/elasticsearch/elasticsearch.pid ExecStart=/usr/share/elasticsearch/bin/elasticsearch -p /var/run/elasticsearch/elasticsearch.pid -Des.default.config=$CONF_FILE -Des.default.path.home=$ES_HOME -Des.default.path.logs=$LOG_DIR -Des.default.path.data=$DATA_DIR -Des.default.path.work=$WORK_DIR -Des.default.path.conf=$CONF_DIR +# See MAX_OPEN_FILES in sysconfig +LimitNOFILE=65535 +# See MAX_LOCKED_MEMORY in sysconfig, use "infinity" when MAX_LOCKED_MEMORY=unlimited and using bootstrap.mlockall: true +#LimitMEMLOCK=infinity [Install] WantedBy=multi-user.target