# Systemd services' settings in deb packages

**URL:** <https://discuss.elastic.co/t/systemd-services-settings-in-deb-packages/295452>\
**Category:** Meta Elastic\
**Created:** [January 26, 2022, 12:52pm UTC](https://discuss.elastic.co/t/systemd-services-settings-in-deb-packages/295452 "2022-01-26T12:52:15Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alexandrpaliy](https://avatars.discourse-cdn.com/v4/letter/a/f0a364/32.png) [@alexandrpaliy](https://discuss.elastic.co/u/alexandrpaliy)\
**Post date:** [January 26, 2022, 12:52pm UTC](https://discuss.elastic.co/t/systemd-services-settings-in-deb-packages/295452/1 "2022-01-26T12:52:15Z")

</div>

Hi all.  
Just figured out that in deb packages, provided by your repo, systemd.service's 'Restart=' option is... inconsistent?

```auto
$ systemctl cat elasticsearch | grep ^Restart
<empty>

$ systemctl cat logstash | grep ^Restart
Restart=always

$ systemctl cat kibana | grep ^Restart
Restart=on-failure
RestartSec=3

```

I've tried to google about it, but can't find anything useful so far. So I decided to post it here.

Are there any reasons to make Restart\* settings different?  
I guess, Elasticsearch.service can have Restart disabled because of possible complications, if some node in a complex cluster will try to restart by itself (I'm not very qualified with setups like these, but I see the possibility).  
But, why does logstash.service has 'Restart=always' instead of 'Restart=on-failure'?

Reference:  
systemd.service manual for latest systemd release - [systemd.service](https://www.freedesktop.org/software/systemd/man/systemd.service.html#Restart=)

**update** :  
One more question. I had Just tested this on a clean VM just to be sure that I'm not wrong and found this:

```auto
root@box1:~# systemctl cat elasticsearch | head -n 1
# /lib/systemd/system/elasticsearch.service

root@box1:~# systemctl cat logstash | head -n 1
# /etc/systemd/system/logstash.service

root@box1:~# systemctl cat kibana | head -n 1
# /etc/systemd/system/kibana.service

```

Placing logstash abn kibana service files directly into /etc/systemd kinda violates systemd principles: [systemd.unit](https://www.freedesktop.org/software/systemd/man/systemd.unit.html#Unit%20File%20Load%20Path)

```auto
Path Description
...
/etc/systemd/system System units created by the administrator
...
/usr/lib/systemd/system System units installed by the distribution package manager

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 23, 2022, 12:53pm UTC](https://discuss.elastic.co/t/systemd-services-settings-in-deb-packages/295452/2 "2022-02-23T12:53:14Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
