[Unit] Description=ElasticSearch Documentation=http://www.elasticsearch.org After=network.target [Service] Type=forking User=elasticsearch Group=elasticsearch ExecStartPre=-/usr/bin/install -o elasticsearch -g elasticsearch -d /var/lib/elasticsearch ExecStartPre=-/usr/bin/install -o elasticsearch -g elasticsearch -d /var/log/elasticsearch ExecStart=/usr/bin/elasticsearch -d -p /run/elasticsearch/elasticsearch.pid EnvironmentFile=-/etc/default/elasticsearch RuntimeDirectory=elasticsearch PIDFile=/run/elasticsearch/elasticsearch.pid LimitNOFILE=65535 LimitMEMLOCK=infinity TimeoutStopSec=20 Restart=on-failure [Install] WantedBy=multi-user.target