Page MenuHomeFreeBSD

sysutils/snmp_exporter: clean up Makefile and use prometheus user/group
Needs ReviewPublic

Authored by fabian.freyer_physik.tu-berlin.de on Feb 28 2018, 9:52 PM.

Details

Reviewers
lwhsu
mat
Summary

following up on @mat's comments over at D14537, I also updated this port to address the same issues:

  • don't run daemons as nobody, but use prometheus user / group
  • use DISTVERSION
  • correct ordering

Diff Detail

Repository
rS FreeBSD src repository
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

mat added inline comments.Mar 1 2018, 11:55 AM
sysutils/snmp_exporter/files/snmp_exporter.in
43–47

Mmmm, unless the pid file is removed when the daemon is stopped, it may have been created using nobody, and the daemon will not be able to write to it under the prometheus group.

sysutils/snmp_exporter/files/snmp_exporter.in
43–47

hmm, how should I fix this, add something to pkg-message?

mat added inline comments.Mar 5 2018, 2:51 PM
sysutils/snmp_exporter/files/snmp_exporter.in
43–47

Why not simply remove the file here before creating it?

sysutils/snmp_exporter/files/snmp_exporter.in
43–47

As in, just ${RM} -f it, and remove the whole -e check?

mat added inline comments.Mar 6 2018, 4:35 PM
sysutils/snmp_exporter/files/snmp_exporter.in
43–47

Yes, or you could add a test to check that it has the correct user, and chown or rm it if it has the wrong user. (And make a note to remove this check in like two years when you're sure that it is not needed any more.

lwhsu added a comment.Mar 21 2018, 5:48 AM

I think this is good to go. How do you think, @mat?

lwhsu added a comment.Mar 21 2018, 5:49 AM

BTW, @fabian.freyer_physik.tu-berlin.de , how do you think if we move this to net-mgmt to align with prometheus itself and other exporters?

@lwhsu: sorry for not answering sooner. That sounds like a good idea. What would need to be done to move this?

lwhsu added a comment.Jun 2 2018, 10:21 AM

@lwhsu: sorry for not answering sooner. That sounds like a good idea. What would need to be done to move this?

I'll take care of it.