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"
Created attachment 477208 [details] Patched ebuild
Created attachment 477210 [details] systemd unit file
Manuel, can you please consider integrating this patch? It is really simple and won't break any non-systemd installation.
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"
(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.
Any progress regarding this issue?
There's a unit file in 0.17.0-r1