Auto Restart Services
1) Edit elasticsearch service unit file using the following command
systemctl edit elasticsearch.serviceĀ
2) Now, add the following lines in the unit file.
[Service]
Restart=always
3) Refresh the unit file using command
sudo systemctl daemon-reload