Telegraf installation ending with "WARNING: systemd not running."

Hi,
I’m trying to install Telegraf 1.25.0-1 together with InfluxDB v1.8.10 on my 32bit Raspberry. InfluxDB installation succeeds. Telegraf installation ends with:

Job for telegraf.service failed because the control process exited with error code.
See “systemctl status telegraf.service” and “journalctl -xe” for details.
WARNING: systemd not running.

When checking the service status I get:

$ sudo systemctl status telegraf.service
● telegraf.service - Telegraf
Loaded: loaded (/lib/systemd/system/telegraf.service; enabled; vendor preset: enabled)
Active: activating (start) since Wed 2023-01-11 00:20:25 CET; 10s ago
Docs: GitHub - influxdata/telegraf: The plugin-driven server agent for collecting & reporting metrics.
Main PID: 10016 (telegraf)
Tasks: 5 (limit: 415)
CPU: 2.333s
CGroup: /system.slice/telegraf.service
└─10016 /usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d
Jän 11 00:20:25 idefixx systemd[1]: Starting Telegraf…

My questions:

  • How can I check wheter systemd is really not running?
  • Where do I find the exit code? “systemctl status telegraf.service” and “journalctl -xe” don’t show an exit code.
  • What could be the reason for failing? How can I fix it?

Thx, idefixx

systemctl is the command to see what systemd units are running. That said this message, as a warning, can be ignored. I believe if you show the full log you may have seen a Failed to enable unit: File telegraf.service: Bad message message just before that warning or something similar.

What could be the reason for failing? How can I fix it?

We changed the packaging in v1.25 so the service does not start right away. The first upgrade will produce a warning.

Put your telegraf config in place and start the service and see if things come up.

I put telegraf.conf in place now, but the service still doesn’t come up:

$ systemctl reload telegraf.service
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Legitimierung ist zum erneuten Laden von »telegraf.service« notwendig.
Authenticating as: , (idefixx)
Password:
==== AUTHENTICATION COMPLETE ===
Job for telegraf.service failed because the control process exited with error code.
See “systemctl status telegraf.service” and “journalctl -xe” for details.
sudo systemctl status telegraf.service
● telegraf.service - Telegraf
Loaded: loaded (/lib/systemd/system/telegraf.service; enabled; vendor preset: enabled)
Active: activating (start) since Thu 2023-01-12 07:43:11 CET; 1s ago
Docs: GitHub - influxdata/telegraf: The plugin-driven server agent for collecting & reporting metrics.
Main PID: 10788 (telegraf)
Tasks: 4 (limit: 415)
CPU: 197ms
CGroup: /system.slice/telegraf.service
└─10788 /usr/bin/telegraf -config /etc/telegraf/telegraf.conf -config-directory /etc/telegraf/telegraf.d

Jän 12 07:43:11 idefixx systemd[1]: Starting Telegraf…

“systemctl status telegraf.service” and “journalctl -xe” don’t show an exit code.

Sorry, this information about exit code

The process’ exit code is ‘exited’ and its exit status is 1.

Can you please run this command outside the service. It should print all the logs to stdout so we can figure out what is failing more easily.

Great, this helped me to find the reason. This way I was displayed an error message coming from a mistake in the telegraf.conf file. I forgot to uncomment the [[inputs.modbus]] line. Transfering data to InfluxDB via Telegraf is working now.
Thank you for your big help!