How do I build a beat to work as a service on linux

Hi,
I'm writing a new beat (will be posted when done) and I was wondering how do I build the beat as a service on Linux system?

In windows I just used the PS script to create a service - easy.
But for Linux I see that the original beats are using something called *beat-god (for example, topbeat-god), what is it and how do I use it with my beat?

Thanks,
Adi.

It's this project. We use it because Go doesn't make it easy to daemonize properly. We only use it in the init scripts, if systemd is available, we use that instead.

For creating all the packages we use "beats packer", which you can find here. If you used the Beat Generator to bootstrap your beat, it should be pretty easy to use it yourself. See the Package section in the README.

Let me know if you hit any issues, I did change a few things recently in the packer.

Thanks Tudor!! works flawlessly!

1 Like

Actually, one more question please...

It only built 2 rpms - for Linux, and on the documentation it says that if I run:
make clean && make -j2

it will build for all OS, did I do something wrong?

It should build for all OSes, yes. Does it print any errors? I'd leave out the -j2, btw.

worked after dropping the -j2.

Thanks again!