<commit_before>## !!! File managed by puppet !!
# ElasticSearch Service

description     "ElasticSearch"

start on (net-device-up
          and local-filesystems
          and runlevel [2345])

stop on runlevel [016]

respawn limit 10 5

env ES_HOME=<%= @es_home %>
env ES_MIN_MEM=<%= @es_min_mem %>
env ES_MAX_MEM=<%= @es_max_mem %>
env DAEMON="${ES_HOME}/bin/elasticsearch"
env DATA_DIR="${ES_HOME}/data"
env LOG_DIR="${ES_HOME}/logs"
env CONFIG_DIR="${ES_HOME}/config"

console output

expect daemon

kill timeout 10

limit nofile 16384 32768

script
  if [ -f /etc/default/elasticsearch ]; then
    . /etc/default/elasticsearch
  fi

  cd $ES_HOME
  su -s /bin/bash -c "${DAEMON} -f -Des.path.conf=$CONFIG_DIR -Des.path.home=$ES_HOME -Des.path.logs=$LOG_DIR -Des.path.data=$DATA_DIR -Des.path.work=$WORK_DIR" <%= @run_as_user %>
end script

pre-stop script
  exec curl -XPOST http://localhost:9200/_shutdown<commit_msg>i guess it's not truly daemonizing.  oops<commit_after>## !!! File managed by puppet !!
# ElasticSearch Service

description     "ElasticSearch"

start on (net-device-up
          and local-filesystems
          and runlevel [2345])

stop on runlevel [016]

respawn limit 10 5

env ES_HOME=<%= @es_home %>
env ES_MIN_MEM=<%= @es_min_mem %>
env ES_MAX_MEM=<%= @es_max_mem %>
env DAEMON="${ES_HOME}/bin/elasticsearch"
env DATA_DIR="${ES_HOME}/data"
env LOG_DIR="${ES_HOME}/logs"
env CONFIG_DIR="${ES_HOME}/config"

console output

kill timeout 10

limit nofile 16384 32768

script
  if [ -f /etc/default/elasticsearch ]; then
    . /etc/default/elasticsearch
  fi

  cd $ES_HOME
  su -s /bin/bash -c "${DAEMON} -f -Des.path.conf=$CONFIG_DIR -Des.path.home=$ES_HOME -Des.path.logs=$LOG_DIR -Des.path.data=$DATA_DIR -Des.path.work=$WORK_DIR" <%= @run_as_user %>
end script

pre-stop script
  exec curl -XPOST http://localhost:9200/_shutdown
{'fraction_non_alphanumeric': 0.14308768154922, 'fraction_numerical': 0.027972027972027972, 'mean_word_length': 4.0, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6518504', 'n_tokens_mistral': 737, 'n_tokens_neox': 677, 'n_words': 167}