# Use Own Systemd Unit File

**URL:** <https://discuss.elastic.co/t/use-own-systemd-unit-file/208518>\
**Category:** Logstash\
**Created:** [November 19, 2019, 2:00pm UTC](https://discuss.elastic.co/t/use-own-systemd-unit-file/208518 "2019-11-19T14:00:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomx1](https://avatars.discourse-cdn.com/v4/letter/t/779978/32.png) [@tomx1](https://discuss.elastic.co/u/tomx1)\
**Post date:** [November 19, 2019, 2:00pm UTC](https://discuss.elastic.co/t/use-own-systemd-unit-file/208518/1 "2019-11-19T14:00:55Z")

</div>

I would like to use my own systemd unit file for logstash because I am starting a dedicated logstash process for each configfile via initscript.

I noticed that the logstash unit file is generated via `/usr/share/logstash/bin/system-install`. Not only during installation, it seems that this happens regulary. How can I disable this "feature" so i can use my own systemd unit file for logstash?

---

<div class="post-metadata">

**Author:** ![tomx1](https://avatars.discourse-cdn.com/v4/letter/t/779978/32.png) [@tomx1](https://discuss.elastic.co/u/tomx1)\
**Post date:** [November 19, 2019, 2:17pm UTC](https://discuss.elastic.co/t/use-own-systemd-unit-file/208518/2 "2019-11-19T14:17:38Z")

</div>

Ok I found the reason why the file has been overwritten regulary. This has been done by the logstash puppet module, I've changed the corresponding lines:

```
# Invoke 'system-install', which generates startup scripts based on the
# contents of the 'startup.options' file.
# Only if restart_on_change is not false
if $::logstash::restart_on_change {
  exec { 'logstash-system-install':
   #command => "${logstash::home_dir}/bin/system-install",
    command => "/bin/true",
    refreshonly => true,
    notify => Service['logstash'],
  }
} else {
  exec { 'logstash-system-install':
   #command => "${logstash::home_dir}/bin/system-install",
    command => "/bin/true",
    refreshonly => true,
  }
}
```

---

<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:** [December 17, 2019, 2:17pm UTC](https://discuss.elastic.co/t/use-own-systemd-unit-file/208518/3 "2019-12-17T14:17:39Z")

</div>

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