How to generate init scripts for community beats?

I was just experimenting with apachebeat. I was able to get it working well on the test server. Then I was ready to add it to more server, but realized that it did not come with an init file.

What is the best way to get init files working for community beats that don't have them already? On Ubuntu, CentOS, etc.

I did find this. so I assume there's a way for beat owners to generate init scripts automatically.

Is there a way I could do that myself?

Hmm... could I change line 10 in this file from:

winlogbeat/win \

To:

winlogbeat/win apachebeat/deb \

to get an apachebeat.deb file with the correct init script? Assuming I check apachebeat out into the root of the beats directory.

I'm currently making the docker images, then I try it myself.

I'm posting this first because I'm hoping someone will have a cleaner way of doing this. :slight_smile:

We recently added a folder dev-tools/packer to beats generated based on beat-generator. This allows to create packages. The folder can be found here: https://github.com/elastic/beat-generator/tree/master/{{cookiecutter.beat}}/dev-tools/packer

The easiest way would be probably to open a PR with this dev-tools folder to the apachebeat and check if it works with apachebeat. There are some dependencies on the Makefile like build-bofore is required.

Let me know if you need some more details or get stuck.

Hmm, I was experimenting with what is in the dev-tools/packer directory in the main beats repo. Didn't get very far... I'll try again soon with the link you gave me. Thanks.

@jerrac Let me know if you run into some problems as this is still very fresh.