The node_exporter now has a systemd unit file but it does not work properly: 1. The path in the service file is wrong, instead of /usr/bin/node_exporter it calls /usr/sbin/node_exporter 2. The systemd unit tries to load the configuration from a file /etc/sysconfig/node_exporter but this path is installed as a directory and the configuration is installed in /etc/sysconfig/node_exporter/sysconfig.node_exporter
Both problems still persist in version 0.18.1.
Created attachment 584910 [details, diff] Patch fixing the wrong paths in systemd unit file I created a patch that fixes the problem by correcting the paths in the systemd unit file and therefore remains compatible with existing installations not using systemd. For the ebuild only the following variable must be added: PATCHES=("${FILESDIR}"/${P}-systemd.patch)
I can confirm the problem with version 0.18.1. I can also confirm that the provided patch works. Thanks!
Actually the whole /etc/sysconfig should be dropped, as this is a RedHat-ism. In RedHat we have /etc/conf.d for this. There is no reason for not using /etc/conf.d/node_exporter for both openrc and systemd. Ideally though, the whole EnvironmentFile is dropped and the user is encouraged to use systemd overrides (systemctl edit node_exporter.service).
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=13ace9cf0a40ff74547390ee0976ada47bd1c2bf commit 13ace9cf0a40ff74547390ee0976ada47bd1c2bf Author: Mikle Kolyada <zlogene@gentoo.org> AuthorDate: 2021-04-07 08:27:59 +0000 Commit: Mikle Kolyada <zlogene@gentoo.org> CommitDate: 2021-04-07 08:59:47 +0000 app-metrics/node_exporter: fix broken systemd support Closes: https://bugs.gentoo.org/679312 Package-Manager: Portage-3.0.17, Repoman-3.0.2 Signed-off-by: Mikle Kolyada <zlogene@gentoo.org> app-metrics/node_exporter/files/node_exporter.service | 7 +++++-- .../{node_exporter-1.1.2.ebuild => node_exporter-1.1.2-r1.ebuild} | 8 +++----- 2 files changed, 8 insertions(+), 7 deletions(-)