Apm-server SystemD unit file?

Hello all,

has anyone tried to create a apm-server SystemD unit file? I'm working on a puppet manifest to install apm-server and would like to manage the service using SystemD.

Cheers,
AB

I copied the Elasticsearch unit file and made a few changes. Seems to be running ok :slight_smile:

@A_B glad to hear it. This is what ends up packaged with apm-server:

[Unit]
Description=apm-server
Documentation=https://www.elastic.co/guide/en/apm/server/
Wants=network-online.target
After=network-online.target

[Service]
ExecStart=/usr/share/apm-server/bin/apm-server -c /etc/apm-server/apm-server.yml -path.home /usr/share/apm-server -path.config /etc/apm-server -path.data /var/lib/apm-server -path.logs /var/log/apm-server
Restart=always

[Install]
WantedBy=multi-user.target

Please let us know if you have improvements that you'd like to contribute back!

Thanks @gil,

I couldn't find one after installing the Debian package so that's why I made my own.

Should apm-server always run as user root or does it matter?

Cheers,
AB

It's generated at packaging time so it's a bit hard to find here. There's no need to run as root - as long as it's able to open the listener, write logs, read the conf, etc you should be good to go. Good luck!

Cool, thank you very much for the info @gil !

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