Systemd config for latest release v0.47.0 points to the incorrect path of the binary for otelcol-contrib in the rpm release:
otelcol-contrib_0.47.0_linux_amd64.rpm.
Due to this otelcol-contrib service can't be started without first modifying the path of the binary.
$ rpm -qa |grep otelcol-contrib
otelcol-contrib-0.47.0-1.x86_64
$ rpm -ql otelcol-contrib
/etc/otelcol-contrib/config.yaml
/etc/otelcol-contrib/otelcol-contrib.conf
/lib/systemd/system/otelcol-contrib.service
/usr/bin/otelcol-contrib
$ cat /usr/lib/systemd/system/otelcol-contrib.service
[Unit]
Description=OpenTelemetry Collector Contrib
After=network.target
[Service]
EnvironmentFile=/etc/otelcol-contrib/otelcol-contrib.conf
ExecStart=/usr/local/bin/otelcol-contrib $OTELCOL_OPTIONS
KillMode=mixed
Restart=on-failure
Type=simple
User=otelcol-contrib
Group=otelcol-contrib
[Install]
WantedBy=multi-user.target
$ systemctl status otelcol-contrib.service -l
● otelcol-contrib.service - OpenTelemetry Collector Contrib
Loaded: loaded (/usr/lib/systemd/system/otelcol-contrib.service; enabled; vendor preset: disabled)
Active: failed (Result: start-limit) since Thu 2022-03-24 14:52:54 UTC; 8min ago
Process: 5864 ExecStart=/usr/local/bin/otelcol-contrib $OTELCOL_OPTIONS (code=exited, status=203/EXEC)
Main PID: 5864 (code=exited, status=203/EXEC)
Mar 24 14:52:54 opentelemetry-collector-test systemd[1]: otelcol-contrib.service: main process exited, code=exited, status=203/EXEC
Mar 24 14:52:54 opentelemetry-collector-test systemd[1]: Unit otelcol-contrib.service entered failed state.
Mar 24 14:52:54 opentelemetry-collector-test systemd[1]: otelcol-contrib.service failed.
Mar 24 14:52:54 opentelemetry-collector-test systemd[1]: otelcol-contrib.service holdoff time over, scheduling restart.
Mar 24 14:52:54 opentelemetry-collector-test systemd[1]: Stopped OpenTelemetry Collector Contrib.
Mar 24 14:52:54 opentelemetry-collector-test systemd[1]: start request repeated too quickly for otelcol-contrib.service
Mar 24 14:52:54 opentelemetry-collector-test systemd[1]: Failed to start OpenTelemetry Collector Contrib.
Mar 24 14:52:54 opentelemetry-collector-test systemd[1]: Unit otelcol-contrib.service entered failed state.
This version worked out of the box, as the binary is in the /usr/local/bin path here
$ rpm -qa |grep otelcol-contrib
otelcol-contrib-0.46.0-1.x86_64
$ rpm -ql otelcol-contrib
/etc/otelcol-contrib/config.yaml
/etc/otelcol-contrib/otelcol-contrib.conf
/lib/systemd/system/otelcol-contrib.service
/usr/local/bin/otelcol-contrib
$ cat /lib/systemd/system/otelcol-contrib.service
[Unit]
Description=OpenTelemetry Collector Contrib
After=network.target
[Service]
EnvironmentFile=/etc/otelcol-contrib/otelcol-contrib.conf
ExecStart=/usr/local/bin/otelcol-contrib $OTELCOL_OPTIONS
KillMode=mixed
Restart=on-failure
Type=simple
User=otelcol-contrib
Group=otelcol-contrib
[Install]
WantedBy=multi-user.target