[Unit]
Description=Anypoint Monitoring OpenTelemetry Collector Service
Documentation=https://github.com/mulesoft-emu/dias-agent-installer
Wants=network-online.target
After=network-online.target

[Service]
Type=forking
PIDFile=/etc/otel-collector/am-agent.pid
Environment=MULE_HOME=$muleHome$
Environment=AM_HOME=$muleHome$/am/
Environment=JAVA_HOME=$javaHome$
Environment=GOMEMLIMIT=$gomemlimit$
ExecStart=/bin/bash $muleHome$/am/bin/am start-otel -s
ExecReload=/bin/bash $muleHome$/am/bin/am restart-otel -s
ExecStop=/bin/bash $muleHome$/am/bin/am stop-otel -s
Restart=always
RestartSec=10

[Install]
WantedBy=multi-user.target
