# Setup logstash as system daemon

**URL:** <https://discuss.elastic.co/t/setup-logstash-as-system-daemon/251401>\
**Category:** Logstash\
**Created:** [October 8, 2020, 8:53am UTC](https://discuss.elastic.co/t/setup-logstash-as-system-daemon/251401 "2020-10-08T08:53:32Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Somesh\_ng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/somesh_ng/32/76440_2.png) [@Somesh\_ng](https://discuss.elastic.co/u/Somesh_ng)\
**Post date:** [October 8, 2020, 8:53am UTC](https://discuss.elastic.co/t/setup-logstash-as-system-daemon/251401/1 "2020-10-08T08:53:32Z")

</div>

Can someone help me in setting up logstash as a system daemon. I have download logstash-7.9.1.tar.gz

---

<div class="post-metadata">

**Author:** ![grumo35](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grumo35/32/59451_2.png) [@grumo35](https://discuss.elastic.co/u/grumo35)\
**Post date:** [October 8, 2020, 9:02am UTC](https://discuss.elastic.co/t/setup-logstash-as-system-daemon/251401/2 "2020-10-08T09:02:56Z")

</div>

Just extract the binaries and logstash is runnable, you might want to document yourself on how to create a systemd service.

Just google it !

---

<div class="post-metadata">

**Author:** ![Somesh\_ng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/somesh_ng/32/76440_2.png) [@Somesh\_ng](https://discuss.elastic.co/u/Somesh_ng)\
**Post date:** [October 9, 2020, 4:18am UTC](https://discuss.elastic.co/t/setup-logstash-as-system-daemon/251401/3 "2020-10-09T04:18:12Z")

</div>

I have Googled and tried to setup. It Start's the process and exit with the below error

```auto
root@dev-server:~# systemctl status logstash
● logstash.service - logstash
   Loaded: loaded (/etc/systemd/system/logstash.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Fri 2020-10-09 04:14:51 UTC; 4s ago
  Process: 46465 ExecStart=/app01/logstash-7.9.1/bin/logstash --path.settings /app01/logstash-7.9.1/config (code=exited, status=216/GROUP)
 Main PID: 46465 (code=exited, status=216/GROUP)

Oct 09 04:14:51 dev-server systemd[1]: Started logstash.
Oct 09 04:14:51 dev-server systemd[46465]: logstash.service: Failed to determine group credentials: No such process
Oct 09 04:14:51 dev-server systemd[46465]: logstash.service: Failed at step GROUP spawning /app01/logstash-7.9.1/bin/logstash: No such process
Oct 09 04:14:51 dev-server systemd[1]: logstash.service: Main process exited, code=exited, status=216/GROUP
Oct 09 04:14:51 dev-server systemd[1]: logstash.service: Failed with result 'exit-code'.

```

```auto
    root@dev-server:~# cat /etc/systemd/system/logstash.service
[Unit]
Description=logstash

[Service]
Type=simple
User=root
Group=root
# 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=/logstash-7.9.1/bin/logstash "--path.settings" "/logstash-7.9.1/config"
#Restart=always
WorkingDirectory=/
Nice=19
LimitNOFILE=16384

# When stopping, how long to wait before giving up and sending SIGKILL?
# Keep in mind that SIGKILL on a process can cause data loss.
TimeoutStopSec=infinity

[Install]
WantedBy=multi-user.target

```

---

<div class="post-metadata">

**Author:** ![Somesh\_ng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/somesh_ng/32/76440_2.png) [@Somesh\_ng](https://discuss.elastic.co/u/Somesh_ng)\
**Post date:** [October 9, 2020, 4:43am UTC](https://discuss.elastic.co/t/setup-logstash-as-system-daemon/251401/4 "2020-10-09T04:43:46Z")

</div>

I got the fix. `logstash-7.9.1` folder was under different user. I changed it root user. It started working.

---

<div class="post-metadata">

**Author:** ![grumo35](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/grumo35/32/59451_2.png) [@grumo35](https://discuss.elastic.co/u/grumo35)\
**Post date:** [October 12, 2020, 6:47am UTC](https://discuss.elastic.co/t/setup-logstash-as-system-daemon/251401/5 "2020-10-12T06:47:31Z")

</div>

Well done !

---

<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:** [November 9, 2020, 6:47am UTC](https://discuss.elastic.co/t/setup-logstash-as-system-daemon/251401/6 "2020-11-09T06:47:32Z")

</div>

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