# What kind of init script support will we get?

**URL:** https://discuss.elastic.co/t/what-kind-of-init-script-support-will-we-get/32810
**Category:** Beats
**Tags:** filebeat
**Created:** [October 22, 2015, 10:16pm UTC](https://discuss.elastic.co/t/what-kind-of-init-script-support-will-we-get/32810 "2015-10-22T22:16:21Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![jerrac](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jerrac/32/52980_2.png) [@jerrac](https://discuss.elastic.co/u/jerrac)
#### Post date: [October 22, 2015, 10:16pm UTC](https://discuss.elastic.co/t/what-kind-of-init-script-support-will-we-get/32810/1 "2015-10-22T22:16:21Z")

</div>

One of the biggest issues I have with LSF is getting "service logstash-forwarder " to work on all my servers. Ubuntu is easy, but CentOS and OES/SLES were painful. On OES/SLES I ended up just using monit to make it work.

The problem was that LSF didn't supply an init script compatible with OES/SLES. If I hadn't used the monit solution, I would have had to write one from scratch.

So, what OS's will have "service filebeat " support from the official .deb and .rpm packages?

---

<div class="post-metadata">

### Author: ![tudor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tudor/32/3753_2.png) [@tudor](https://discuss.elastic.co/u/tudor)
#### Post date: [October 23, 2015, 8:30am UTC](https://discuss.elastic.co/t/what-kind-of-init-script-support-will-we-get/32810/2 "2015-10-23T08:30:51Z")

</div>

We test each release on CentOS 6 and 7, so that should work without issues. OpenSuse was reported not to work in this [ticket](https://github.com/elastic/packetbeat/issues/259), but it should be easy to adjust the init script, we'll try to do it soon.

I'm not very familiar with OES/SLES, so I have some questions: if we add tests for OpenSuse can we expect the packages to work well on OES/SLES? Which versions do you suggest we should test with to cover most of the user base?

---

<div class="post-metadata">

### Author: ![jerrac](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jerrac/32/52980_2.png) [@jerrac](https://discuss.elastic.co/u/jerrac)
#### Post date: [October 23, 2015, 4:25pm UTC](https://discuss.elastic.co/t/what-kind-of-init-script-support-will-we-get/32810/3 "2015-10-23T16:25:32Z")

</div>

Here's what my co-worker who understands Novell said:

> SLES and OpenSUSE have diverged quite a bit over the last few  
> years. The biggest difference is that OpenSUSE has switched to SystemD  
> and SLES still uses init. Other than that, SLES is a few years behind in  
> most of it's packages. You'd have to go through the requirements for  
> the new app and see if SLES can meet them. SLES  
> does have a 30 day download that Elastic can use for testing or Elastic  
> can contact Novell and become part of the PartnerNet which will give  
> them access to the Novell software for testing and certification  
> purposes.

As for version numbers:

> SLES 11 Service Pack 3

> OES 11 Service Pack 2

---

<div class="post-metadata">

### Author: ![crazyphil](https://avatars.discourse-cdn.com/v4/letter/c/9f8e36/32.png) [@crazyphil](https://discuss.elastic.co/u/crazyphil)
#### Post date: [December 3, 2015, 3:32pm UTC](https://discuss.elastic.co/t/what-kind-of-init-script-support-will-we-get/32810/4 "2015-12-03T15:32:31Z")

</div>

I am running Centos 7 in AWS and have been unable to get filebeat to start as a service no matter what I do.

if I execute "service filebeat start" it says "ok", but filebeat is not actually running, nor can I find a single log message anywhere indicating what the issue is.

if I execute /etc/init.d/filebeat start, it runs correctly. I tried converting to a systemd service, and similarly filebeat-god does not start, nor does it leave any log messages anywhere. There are no errors from selinux either saying something was denied.

Very frustrating.

---

<div class="post-metadata">

### Author: ![tudor](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tudor/32/3753_2.png) [@tudor](https://discuss.elastic.co/u/tudor)
#### Post date: [December 7, 2015, 4:38pm UTC](https://discuss.elastic.co/t/what-kind-of-init-script-support-will-we-get/32810/5 "2015-12-07T16:38:06Z")

</div>

Can you share the systemd unit file? The trick is that if you use systemd, you don't need filebeat-god. That's a simple supervisor that can be easily replaced by systemd.

---

<div class="post-metadata">

### Author: ![pat7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pat7/32/81768_2.png) [@pat7](https://discuss.elastic.co/u/pat7)
#### Post date: [December 21, 2015, 7:56pm UTC](https://discuss.elastic.co/t/what-kind-of-init-script-support-will-we-get/32810/6 "2015-12-21T19:56:15Z")

</div>

Hi, i have the same problem with SLES 11. The service just won't start ☹  
I installed the RPM version and copied my working (on ubunto 14.03 LTS) filebeat.yml to the machine an restart the service:  
linux-ncsm:/ # service filebeat restart  
/etc/init.d/filebeat: line 34: /etc/rc.d/init.d/functions: No such file or directory  
/etc/init.d/filebeat: line 38: status: command not found  
Stopping filebeat:  
Starting filebeat: /etc/init.d/filebeat: line 54: daemon: command not found

i had a look in the /etc/init.d/filebeat file and uncommented some things but it won't work either... Can you help me? i just have no clue what to change to make the service run... i think it's a init vs. systemd issue. thank you very much for your answer and developing such a great sw!

---

<div class="post-metadata">

### Author: ![lutzm](https://avatars.discourse-cdn.com/v4/letter/l/9f8e36/32.png) [@lutzm](https://discuss.elastic.co/u/lutzm)
#### Post date: [January 7, 2016, 1:50pm UTC](https://discuss.elastic.co/t/what-kind-of-init-script-support-will-we-get/32810/7 "2016-01-07T13:50:06Z")

</div>

Hi Patrick,  
I had the same problem when I installed filebeat today. One problem that "daemon" is not available on SLES so the script have to be modified.

Here's my version I changed to use startproc instead of daemon.

```
#!/bin/bash
#
# filebeat filebeat shipper
#
# chkconfig: 2345 98 02
#

### BEGIN INIT INFO
# Provides: filebeat
# Required-Start: $local_fs $network $syslog
# Required-Stop: $local_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Sends log files to Logstash or directly to Elasticsearch.
# Description: filebeat is a shipper part of the Elastic Beats
# family. Please see: https://www.elastic.co/products/beats
### END INIT INFO

PATH=/usr/bin:/sbin:/bin:/usr/sbin
export PATH

[-f /etc/sysconfig/filebeat] && . /etc/sysconfig/filebeat
pidfile=${PIDFILE-/var/run/filebeat.pid}
agent=${PB_AGENT-/usr/bin/filebeat}
args="-c /etc/filebeat/filebeat.yml"
test_args="-e -configtest"
wrapper="/usr/bin/filebeat-god"
wrapperopts="-r / -n -p $pidfile"
RETVAL=0

# Source function library.
. /etc/rc.status
#. /etc/rc.d/init.d/functions

# Determine if we can use the -p option to daemon, killproc, and status.
# RHEL < 5 can't.
if status | grep -q -- '-p' 2>/dev/null; then
    daemonopts="-p $pidfile"
    pidopts="-p $pidfile"
fi

test() {
        $agent $args $test_args
}

start() {
    echo -n $"Starting filebeat: "
        test
        if [$? -ne 0]; then
                echo
                exit 1
        fi
    startproc $daemonopts $wrapper $wrapperopts -- $agent $args
    RETVAL=$?
    echo
    return $RETVAL
}

stop() {
    echo -n $"Stopping filebeat: "
    killproc $pidopts $wrapper
    RETVAL=$?
    echo
    [$RETVAL = 0] && rm -f ${pidfile}
}

restart() {
        test
        if [$? -ne 0]; then
                return 1
        fi
    stop
    start
}

rh_status() {
    status $pidopts $wrapper
    RETVAL=$?
    return $RETVAL
}

rh_status_q() {
    rh_status >/dev/null 2>&1
}

case "$1" in
    start)
        start
    ;;
    stop)
        stop
    ;;
    restart)
        restart
    ;;
    condrestart|try-restart)
        rh_status_q || exit 0
        restart
    ;;
    status)
        rh_status
    ;;
    *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart}"
        exit 1
esac

exit $RETVAL

```

Because startproc parameters are a bit different I had to modiy the daemonopts parameter and enter the full path to the filebeat-god binary. In also had to replace /etc/rc.d/init.d/functions with /etc/rc.status but now the script is working.

Hope that will help.

---

<div class="post-metadata">

### Author: ![pat7](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pat7/32/81768_2.png) [@pat7](https://discuss.elastic.co/u/pat7)
#### Post date: [April 11, 2016, 2:43pm UTC](https://discuss.elastic.co/t/what-kind-of-init-script-support-will-we-get/32810/8 "2016-04-11T14:43:14Z")

</div>

hi @lutzm, thank you very much!!!! it worked 🙂 (i needed to uncomment line 37-41 (the status function), too and add filebeat via yast to autostart)

---

<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: [July 5, 2017, 9:53pm UTC](https://discuss.elastic.co/t/what-kind-of-init-script-support-will-we-get/32810/9 "2017-07-05T21:53:30Z")

</div>


