[Unit] Description=Elasticsearch Documentation=http://www.elastic.co Wants=network-online.target After=network-online.target [Service] Environment=ES_HOME=/usr/local/lib/elasticsearch/ Environment=CONF_DIR=/usr/local/lib/elasticsearch/config/ Environment=PID_DIR=/var/run/elasticsearch #EnvironmentFile=-${path.env} WorkingDirectory=/usr/local/lib/elasticsearch/ User=elasticsearch Group=elasticsearch PermissionsStartOnly=true ExecStart=/usr/local/lib/elasticsearch/bin/elasticsearch -p /var/run/elasticsearch/elasticsearch.pid ExecStartPre=-/bin/mkdir -p /var/run/elasticsearch ExecStartPre=/bin/chmod -R 777 /var/run/elasticsearch StandardOutput=syslog StandardError=syslog # Specifies the maximum file descriptor number that can be opened by this process LimitNOFILE=65536 # Specifies the maximum number of processes LimitNPROC=4096 # Specifies the maximum number of bytes of memory that may be locked into RAM # Set to "infinity" if you use the 'bootstrap.memory_lock: true' option # in elasticsearch.yml and 'MAX_LOCKED_MEMORY=unlimited' in ${path.env} #LimitMEMLOCK=infinity # Disable timeout logic and wait until process is stopped TimeoutStopSec=0 # SIGTERM signal is used to stop the Java process KillSignal=SIGTERM # Send the signal only to the JVM rather than its control group KillMode=process # Java process is never killed SendSIGKILL=no # When a JVM receives a SIGTERM signal it exits with code 143 SuccessExitStatus=143 [Install] WantedBy=multi-user.target