Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 608914

Summary: net-analyzer/prometheus-node_exporter Please add a systemd unit
Product: Gentoo Linux Reporter: Fabian Köster <gentoo>
Component: Current packagesAssignee: Manuel Rüger (RETIRED) <mrueg>
Status: RESOLVED FIXED    
Severity: normal CC: arthur, slyfox, systemd, whissi, zmedico
Priority: Normal Keywords: PATCH
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 448882    
Attachments: systemd unit file
Patched ebuild
systemd unit file

Description Fabian Köster 2017-02-11 10:06:05 UTC
Created attachment 463192 [details]
systemd unit file

The prometheus-node_exporter currently does not come with a systemd unit. I am successfully using the attached one, can you please add it?

Need to add systemd eclass to inherit line and then in src_install run:

systemd_dounit "${FILESDIR}/${PN}.service"
Comment 1 Fabian Köster 2017-06-19 11:38:36 UTC
Created attachment 477208 [details]
Patched ebuild
Comment 2 Fabian Köster 2017-06-19 11:38:59 UTC
Created attachment 477210 [details]
systemd unit file
Comment 3 Fabian Köster 2017-10-18 08:09:48 UTC
Manuel, can you please consider integrating this patch? It is really simple and won't break any non-systemd installation.
Comment 4 Zac Medico gentoo-dev 2018-03-09 20:25:03 UTC
We should probably do something like this:

ExecStart=/usr/bin/node_exporter $NODE_EXPORTER_OPTS

Then users can override NODE_EXPORTER_OPTS with a drop-in file in /etc/systemd/system/prometheus-node_exporter.d/ containing something like this:

[Service]
Environment=NODE_EXPORTER_OPTS="--collector.systemd --collector.foo"
Comment 5 Thomas Deutschmann (RETIRED) gentoo-dev 2018-04-04 02:11:17 UTC
(In reply to Zac Medico from comment #4)
> We should probably do something like this:
> 
> ExecStart=/usr/bin/node_exporter $NODE_EXPORTER_OPTS
> 
> Then users can override NODE_EXPORTER_OPTS with a drop-in file in
> /etc/systemd/system/prometheus-node_exporter.d/ containing something like
> this:
> 
> [Service]
> Environment=NODE_EXPORTER_OPTS="--collector.systemd --collector.foo"
Why still using Environment? Why shouldn't the user just overwrite the whole unit/Exec line?

BTW: The problem isn't unique for node_exporter. Most exporters don't support a config files and require a lot of arguments. This is very hard to reflect in systemd world... and there isn't a sane default and upstream recommends to ship an empty args line.
Comment 6 s 2018-09-26 08:55:41 UTC
Any progress regarding this issue?
Comment 7 Manuel Rüger (RETIRED) gentoo-dev 2019-02-14 12:32:15 UTC
There's a unit file in 0.17.0-r1