Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 608914 - net-analyzer/prometheus-node_exporter Please add a systemd unit
Summary: net-analyzer/prometheus-node_exporter Please add a systemd unit
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Manuel Rüger (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks: install-systemd-unit
  Show dependency tree
 
Reported: 2017-02-11 10:06 UTC by Fabian Köster
Modified: 2019-02-14 12:32 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
systemd unit file (prometheus-node_exporter.service,417 bytes, text/plain)
2017-02-11 10:06 UTC, Fabian Köster
Details
Patched ebuild (prometheus-node_exporter-0.14.0.ebuild,1.23 KB, text/plain)
2017-06-19 11:38 UTC, Fabian Köster
Details
systemd unit file (prometheus-node_exporter.service,405 bytes, text/plain)
2017-06-19 11:38 UTC, Fabian Köster
Details

Note You need to log in before you can comment on or make changes to this bug.
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