# Logstash.service: Unit not found (CentOS 7)

**URL:** https://discuss.elastic.co/t/logstash-service-unit-not-found-centos-7/138446
**Category:** Logstash
**Created:** [July 3, 2018, 7:42pm UTC](https://discuss.elastic.co/t/logstash-service-unit-not-found-centos-7/138446 "2018-07-03T19:42:10Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![weyderfs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weyderfs/32/32935_2.png) [@weyderfs](https://discuss.elastic.co/u/weyderfs)
#### Post date: [July 3, 2018, 7:42pm UTC](https://discuss.elastic.co/t/logstash-service-unit-not-found-centos-7/138446/1 "2018-07-03T19:42:10Z")

</div>

Hi everyone,  
I'm having trouble starting Logstash in my Centos 7. I found several articles on Web, but not found a solution.

My configs:

**Oracle Java 8**

$ echo $JAVA\_HOME  
$ /usr/bin/java

$java -version  
java version "1.8.0\_172"  
Java(TM) SE Runtime Environment (build 1.8.0\_172-b11)  
Java HotSpot(TM) 64-Bit Server VM (build 25.172-b11, mixed mode)

I installed the Logstash by yum following this article: [https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elk-stack-on-centos-7](https://www.digitalocean.com/community/tutorials/how-to-install-elasticsearch-logstash-and-kibana-elk-stack-on-centos-7)

But when run:

$ systemctl start logstash  
Failed to start logstash.service: Unit not found

I try start manually Logstash:  
$/usr/share/logstash/bin/logstash  
WARNING: Could not find logstash.yml which is typically located in $LS\_HOME/config or /etc/logstash. You can specify the path using --path.settings. Continuing using the defaults  
Could not find log4j2 configuration at path /usr/share/logstash/config/log4j2.properties. Using default config which logs errors to the console  
ERROR: Failed to read pipelines yaml file. Location: /usr/share/logstash/config/pipelines.yml  
usage:  
bin/logstash -f CONFIG\_PATH [-t] [-r] [] [-w COUNT] [-l LOG]  
bin/logstash --modules MODULE\_NAME [-M "MODULE\_NAME.var.PLUGIN\_TYPE.PLUGIN\_NAME.VARIABLE\_NAME=VALUE"] [-t] [-w COUNT] [-l LOG]  
bin/logstash -e CONFIG\_STR [-t] [--log.level fatal|error|warn|info|debug|trace] [-w COUNT] [-l LOG]  
bin/logstash -i SHELL [--log.level fatal|error|warn|info|debug|trace]  
bin/logstash -V [--log.level fatal|error|warn|info|debug|trace]  
bin/logstash --help  
[ERROR] 2018-07-03 16:43:51.955 [LogStash::Runner] Logstash - java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit

Someone can help?

---

<div class="post-metadata">

### Author: ![Magnus\_Kessler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnus_kessler/32/42001_2.png) [@Magnus\_Kessler](https://discuss.elastic.co/u/Magnus_Kessler)
#### Post date: [July 4, 2018, 8:48pm UTC](https://discuss.elastic.co/t/logstash-service-unit-not-found-centos-7/138446/2 "2018-07-04T20:48:16Z")

</div>

Centos 7 uses systemd, but the post-installation script of the logstash package erroneously tries to generate an `upstart` script, IIRC.

You can generate the `logstash.service` file for systemd with

```auto
sudo /usr/share/logstash/bin/system-install /etc/logstash/startup.options systemd`

```

---

<div class="post-metadata">

### Author: ![weyderfs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/weyderfs/32/32935_2.png) [@weyderfs](https://discuss.elastic.co/u/weyderfs)
#### Post date: [July 5, 2018, 12:34pm UTC](https://discuss.elastic.co/t/logstash-service-unit-not-found-centos-7/138446/3 "2018-07-05T12:34:36Z")

</div>

Exactly, after running /usr/share/logstash/bin/system-install work for me.

---

<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: [August 2, 2018, 12:43pm UTC](https://discuss.elastic.co/t/logstash-service-unit-not-found-centos-7/138446/4 "2018-08-02T12:43:51Z")

</div>

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