# Logstash run as a background service

**URL:** <https://discuss.elastic.co/t/logstash-run-as-a-background-service/76138>\
**Category:** Logstash\
**Created:** [February 23, 2017, 3:30am UTC](https://discuss.elastic.co/t/logstash-run-as-a-background-service/76138 "2017-02-23T03:30:44Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![theuntergeek](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/theuntergeek/32/44961_2.png) [@theuntergeek](https://discuss.elastic.co/u/theuntergeek)\
**Post date:** [February 24, 2017, 6:36pm UTC](https://discuss.elastic.co/t/logstash-run-as-a-background-service/76138/8 "2017-02-24T18:36:42Z")

</div>

Don't make your own. Logstash can auto-detect the system type and install a script accordingly, or it can be coerced into installing SysV. For CentOS 6.4, the auto-detected startup type would be upstart, so you could start/stop logstash with `initctl`.

Step 1, edit `startup.options`, `logstash.yml`, and `jvm.options` found in `$LS_HOME/config/`  
Step 2, As root, or with sudo, run:

```auto
$LS_HOME/bin/system-install $LS_HOME/config/startup.options

```

for auto-detected system type, or optionally coerce sysv by appending it like this,

```auto
$LS_HOME/bin/system-install $LS_HOME/config/startup.options sysv

```

Be sure to either export `$LS_HOME` or substitute the path where you extracted the tarball. You may also need to export `JAVA_HOME` _before_ running `system-install`.

---

_[View the full topic](https://discuss.elastic.co/t/logstash-run-as-a-background-service/76138)._
