# Filebeat - service should automatically starts

**URL:** https://discuss.elastic.co/t/filebeat-service-should-automatically-starts/213057
**Category:** Beats
**Tags:** filebeat
**Created:** [December 26, 2019, 9:00am UTC](https://discuss.elastic.co/t/filebeat-service-should-automatically-starts/213057 "2019-12-26T09:00:30Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![aolvikash](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@aolvikash](https://discuss.elastic.co/u/aolvikash)
#### Post date: [December 26, 2019, 9:00am UTC](https://discuss.elastic.co/t/filebeat-service-should-automatically-starts/213057/1 "2019-12-26T09:00:30Z")

</div>

Hi,

I have the filebeat running on Freebsd and started the filebeat service via "service filebeat onestart" however I want to run filebeat service automatically in case service has stopped or if the server is rebooted, etc. Filebeat should run all the time. I know we can use "nohup" or cron script, just want to know if any other options.

Any suggestions could be appreciated !!

---

<div class="post-metadata">

### Author: ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)
#### Post date: [December 26, 2019, 1:49pm UTC](https://discuss.elastic.co/t/filebeat-service-should-automatically-starts/213057/2 "2019-12-26T13:49:39Z")

</div>

Hi,

This sounds more like a FreeBSD than Filebeat question and I'll start by admitting that I'm not very familiar with FreeBSD. However, it sounds like what you're looking for is [https://www.freebsd.org/doc/handbook/configtuning-rcd.html](https://www.freebsd.org/doc/handbook/configtuning-rcd.html), specifically the part about adding your service to `/etc/rc.conf`, so something like:

```auto
filebeat_enable="YES"

```

Hope that helps.

Shaunak

---

<div class="post-metadata">

### Author: ![aolvikash](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@aolvikash](https://discuss.elastic.co/u/aolvikash)
#### Post date: [December 30, 2019, 10:27am UTC](https://discuss.elastic.co/t/filebeat-service-should-automatically-starts/213057/3 "2019-12-30T10:27:48Z")

</div>

Many thanks, Shaunak, this will provide the reboot solution

> [filebeat\_enable="YES"

Any suggestion for filebeat service if service is stopped for any reason then service should start automatically.

---

<div class="post-metadata">

### Author: ![shaunak](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/shaunak/32/6643_2.png) [@shaunak](https://discuss.elastic.co/u/shaunak)
#### Post date: [December 30, 2019, 7:59pm UTC](https://discuss.elastic.co/t/filebeat-service-should-automatically-starts/213057/4 "2019-12-30T19:59:31Z")

</div>

> [@aolvikash](#):
>
> Any suggestion for filebeat service if service is stopped for any reason then service should start automatically.

I don't think this is a Filebeat-specific concern. I think you'd be better served by asking this question on a FreeBSD forum, since there might be idiomatic ways of doing this for FreeBSD that you'd want to apply to Filebeat but also any other services.

---

<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 27, 2020, 7:59pm UTC](https://discuss.elastic.co/t/filebeat-service-should-automatically-starts/213057/5 "2020-01-27T19:59:32Z")

</div>

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