# Logstash doesn't run as a service only manually

**URL:** <https://discuss.elastic.co/t/logstash-doesnt-run-as-a-service-only-manually/112652>\
**Category:** Logstash\
**Created:** [December 20, 2017, 2:16pm UTC](https://discuss.elastic.co/t/logstash-doesnt-run-as-a-service-only-manually/112652 "2017-12-20T14:16:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kristoffer\_Fagerlund](https://avatars.discourse-cdn.com/v4/letter/k/b3f665/32.png) [@Kristoffer\_Fagerlund](https://discuss.elastic.co/u/Kristoffer_Fagerlund)\
**Post date:** [December 20, 2017, 2:16pm UTC](https://discuss.elastic.co/t/logstash-doesnt-run-as-a-service-only-manually/112652/1 "2017-12-20T14:16:48Z")

</div>

logstash is only listening to the confed port and receiving messages if Istart it manually with :  
sudo bin/logstash --path.settings /etc/logstash -f /etc/logstash/conf.d/logstash.conf

Starting it as a service and it doesnt receive messages nor are listening to the cofed port  
:/etc/logstash$ sudo systemctl status logstash.service

or sudo service logstash start

:/etc/logstash$ cat /etc/systemd/system/logstash.service  
[Unit]  
Description=logstash

[Service]  
Type=simple  
User=logstash  
Group=logstash  
Load env vars from /etc/default/ and /etc/sysconfig/ if they exist.  
Prefixing the path with '-' makes it try to load, but if the file doesn't  
exist, it continues onward.  
EnvironmentFile=-/etc/default/logstash  
EnvironmentFile=-/etc/sysconfig/logstash  
ExecStart=/usr/share/logstash/bin/logstash "--path.settings" "/etc/logstash"  
Restart=always  
WorkingDirectory=/  
Nice=19  
LimitNOFILE=16384

[Install]  
WantedBy=multi-user.target

---

<div class="post-metadata">

**Author:** ![Kristoffer\_Fagerlund](https://avatars.discourse-cdn.com/v4/letter/k/b3f665/32.png) [@Kristoffer\_Fagerlund](https://discuss.elastic.co/u/Kristoffer_Fagerlund)\
**Post date:** [December 21, 2017, 7:51am UTC](https://discuss.elastic.co/t/logstash-doesnt-run-as-a-service-only-manually/112652/2 "2017-12-21T07:51:44Z")

</div>

Anyone have any idea why logstash as a service cant find the settingfile? Even tho I only use the default paths that was included in the installation ?

---

<div class="post-metadata">

**Author:** ![Kristoffer\_Fagerlund](https://avatars.discourse-cdn.com/v4/letter/k/b3f665/32.png) [@Kristoffer\_Fagerlund](https://discuss.elastic.co/u/Kristoffer_Fagerlund)\
**Post date:** [December 21, 2017, 6:41pm UTC](https://discuss.elastic.co/t/logstash-doesnt-run-as-a-service-only-manually/112652/3 "2017-12-21T18:41:05Z")

</div>

I read one thread here were a user installed xpack and afterwards the logstash serivce failed due to altered rights of /etc/logstash , could that be my case also ?

When I tried chmod it didn't work, I even did 777 on /etc/logstash.

any tips?

---

<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:** [January 18, 2018, 6:41pm UTC](https://discuss.elastic.co/t/logstash-doesnt-run-as-a-service-only-manually/112652/4 "2018-01-18T18:41:30Z")

</div>

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