# On startup run filebeat restart upon fail

**URL:** https://discuss.elastic.co/t/on-startup-run-filebeat-restart-upon-fail/262204
**Category:** Beats
**Tags:** filebeat
**Created:** [January 26, 2021, 8:25am UTC](https://discuss.elastic.co/t/on-startup-run-filebeat-restart-upon-fail/262204 "2021-01-26T08:25:34Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Peter\_Boos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peter_boos/32/72670_2.png) [@Peter\_Boos](https://discuss.elastic.co/u/Peter_Boos)
#### Post date: [January 26, 2021, 8:25am UTC](https://discuss.elastic.co/t/on-startup-run-filebeat-restart-upon-fail/262204/1 "2021-01-26T08:25:34Z")

</div>

On a test machine with Debian 10 with a desktop, filebeat did not startup after a hard VM reset.  
I would like to be sure that on Debian systems with a desktop and headless systems this service restart it self upon failure ( restarting manual on the desktop system worked.. )

How to configure that on Debian  
I'm a bit more into windows where its easy to set reset options for a service.

---

<div class="post-metadata">

### Author: ![borna\_talebi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/borna_talebi/32/76317_2.png) [@borna\_talebi](https://discuss.elastic.co/u/borna_talebi)
#### Post date: [January 26, 2021, 8:54am UTC](https://discuss.elastic.co/t/on-startup-run-filebeat-restart-upon-fail/262204/2 "2021-01-26T08:54:48Z")

</div>

Hi Peter,

> [@Peter\_Boos](#):
>
> I would like to be sure that on Debian systems with a desktop and headless systems this service restart it self upon failure

So in normal conditions, after you restart your VM Filebbeat would start without a problem. correct?  
Do you want to make sure if filebeat service failed for some reason it would automatically restart itself?

---

<div class="post-metadata">

### Author: ![Peter\_Boos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peter_boos/32/72670_2.png) [@Peter\_Boos](https://discuss.elastic.co/u/Peter_Boos)
#### Post date: [January 26, 2021, 9:00am UTC](https://discuss.elastic.co/t/on-startup-run-filebeat-restart-upon-fail/262204/3 "2021-01-26T09:00:12Z")

</div>

Yes your correct normally it should start when the system startup.  
But if for some reason it fails, i like it to restart.  
As especially those moments are interesting times.

---

<div class="post-metadata">

### Author: ![borna\_talebi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/borna_talebi/32/76317_2.png) [@borna\_talebi](https://discuss.elastic.co/u/borna_talebi)
#### Post date: [January 26, 2021, 9:13am UTC](https://discuss.elastic.co/t/on-startup-run-filebeat-restart-upon-fail/262204/4 "2021-01-26T09:13:51Z")

</div>

This is more of a Linux problem than a elasticsearch one. I did something like this for my elasticsearch service But I did it in a CentOS machine. Follow [this guide](https://ma.ttias.be/auto-restart-crashed-service-systemd/). Pay attention to the `Restart=on-failure` part.

---

<div class="post-metadata">

### Author: ![Peter\_Boos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peter_boos/32/72670_2.png) [@Peter\_Boos](https://discuss.elastic.co/u/Peter_Boos)
#### Post date: [January 26, 2021, 9:31am UTC](https://discuss.elastic.co/t/on-startup-run-filebeat-restart-upon-fail/262204/5 "2021-01-26T09:31:34Z")

</div>

I dont know if this is bad ,but i dont have

```auto
 /etc/systemd/system/filebeat.service

```

I installed it as follows on debian10 :

```auto
sudo -i
curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-7.10.1-amd64.deb
sudo dpkg -i filebeat-7.10.1-amd64.deb

filebeat modules enable system
filebeat setup -e          

systemctl status filebeat
systemctl enable filebeat
systemctl start filebeat

```

---

<div class="post-metadata">

### Author: ![borna\_talebi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/borna_talebi/32/76317_2.png) [@borna\_talebi](https://discuss.elastic.co/u/borna_talebi)
#### Post date: [January 26, 2021, 10:11am UTC](https://discuss.elastic.co/t/on-startup-run-filebeat-restart-upon-fail/262204/6 "2021-01-26T10:11:10Z")

</div>

> [@Peter\_Boos](#):
>
> I dont know if this is bad ,but i dont have

It's not. as I said before it might be on a different directory for your OS. unfortunately I don't have a Debian-based system to check that for you. But you could find it with a little bit of searching.

---

<div class="post-metadata">

### Author: ![Peter\_Boos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/peter_boos/32/72670_2.png) [@Peter\_Boos](https://discuss.elastic.co/u/Peter_Boos)
#### Post date: [January 26, 2021, 10:51am UTC](https://discuss.elastic.co/t/on-startup-run-filebeat-restart-upon-fail/262204/7 "2021-01-26T10:51:21Z")

</div>

On the psotive side at least now it has survived several hard resets without config changes.  
And if there truely would be something wrong with a real server its console check anyway.  
For now i give this issue a bit of rest, got to work on other stuff.

If someone knows update the forum, or incase it gets closed (as i've seen with some other interesting question lacking solutions.. then pm me here.

---

<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: [February 23, 2021, 12:51pm UTC](https://discuss.elastic.co/t/on-startup-run-filebeat-restart-upon-fail/262204/8 "2021-02-23T12:51:36Z")

</div>

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