# Logstash 7.1.0 does not start as service RHEL 7

**URL:** <https://discuss.elastic.co/t/logstash-7-1-0-does-not-start-as-service-rhel-7/208279>\
**Category:** Logstash\
**Created:** [November 18, 2019, 9:55am UTC](https://discuss.elastic.co/t/logstash-7-1-0-does-not-start-as-service-rhel-7/208279 "2019-11-18T09:55:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![katara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/katara/32/60143_2.png) [@katara](https://discuss.elastic.co/u/katara)\
**Post date:** [November 18, 2019, 9:55am UTC](https://discuss.elastic.co/t/logstash-7-1-0-does-not-start-as-service-rhel-7/208279/1 "2019-11-18T09:55:48Z")

</div>

I just installed logstash 7.1.0 from an RPM with `sudo yum install logstash.7.1.0.rpm` system has 32 GB RAM.

When im trying to run the service as

```auto
[root@elk02 ~]# sudo systemctl start logstash
Failed to start logstash.service: Unit not found.

[root@elk02 ~]# java -version
java version "1.8.0_231"
Java(TM) SE Runtime Environment (build 1.8.0_231-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.231-b11, mixed mode)

[root@elk02 ~]# sudo /usr/share/logstash/bin/system-install /etc/logstash/startup.options systemd
could not find java; set JAVA_HOME or ensure java is in PATH

[root@elk02 ~]$ cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [-f ~/.bashrc]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

export JAVA_HOME=/opt/jdk1.8.0_231
export JRE_HOME=/opt/jdk1.8.0_231/jre
PATH=$PATH:$JAVA_HOME/bin:$HOME/bin

export PATH

```

Why am i getting the above two errors? How do i fix this?

---

<div class="post-metadata">

**Author:** ![katara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/katara/32/60143_2.png) [@katara](https://discuss.elastic.co/u/katara)\
**Post date:** [November 19, 2019, 4:17am UTC](https://discuss.elastic.co/t/logstash-7-1-0-does-not-start-as-service-rhel-7/208279/3 "2019-11-19T04:17:43Z")

</div>

Hi Team,  
Kindly help me fix this issue.  
I have made a change in the startup.options further to provide the java binary as  
`JAVACMD=/opt/jdk.1.8.0_231/bin/java`  
and tried to run `./system-install`. And i still face the JAVA issue.  
`could not find java; set JAVA_HOME or ensure java is in PATH`

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [November 19, 2019, 3:46pm UTC](https://discuss.elastic.co/t/logstash-7-1-0-does-not-start-as-service-rhel-7/208279/4 "2019-11-19T15:46:05Z")

</div>

If you are already root why are you using sudo?

---

<div class="post-metadata">

**Author:** ![katara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/katara/32/60143_2.png) [@katara](https://discuss.elastic.co/u/katara)\
**Post date:** [November 20, 2019, 6:15am UTC](https://discuss.elastic.co/t/logstash-7-1-0-does-not-start-as-service-rhel-7/208279/5 "2019-11-20T06:15:46Z")

</div>

Solved this issue by adding  
`JAVA_HOME=/path/to/jdk`  
and  
`JAVACMD=/path/to/jdk/bin/java`  
on the startup.options file.

---

<div class="post-metadata">

**Author:** ![katara](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/katara/32/60143_2.png) [@katara](https://discuss.elastic.co/u/katara)\
**Post date:** [November 21, 2019, 8:12am UTC](https://discuss.elastic.co/t/logstash-7-1-0-does-not-start-as-service-rhel-7/208279/6 "2019-11-21T08:12:48Z")

</div>

@badger, I with/without sudo did not make any difference in my error. I have come to find a solution thou 🙂 Thank you very much for looking out for this 🙂

---

<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 19, 2019, 8:13am UTC](https://discuss.elastic.co/t/logstash-7-1-0-does-not-start-as-service-rhel-7/208279/7 "2019-12-19T08:13:00Z")

</div>

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