some weeks ago a change appeared in the port, that spits out this warning at startup: /usr/local/etc/rc.d/snmpd: WARNING: snmpd configuration file /usr/local/share/snmp/snmpd.conf not found Of course there is no such file, because my snmpd.conf is in /usr/local/etc/ where it should be and is correctly configured in rc.conf. However there's one hardcoded check for the file above, which triggers the warning. I guess, that line should simply be removed in the rc script because the following lines do the check anyway with $snmpd_conffile instead of the hardcoded path. The line number is 80 and looks like this: check_conffile /usr/local/share/snmp/snmpd.conf
Can you confirm that commenting that line resolves your issue?
Yes, of course I can confirm. It works without warning, when that line is removed. There shouldn't be any hardcoded paths in there anyway.
(In reply to gebhart from comment #2) It's hard-coded that way because snmpd will still try to read it even if -c is specified. Though, this is false if -C is also specified. Are you setting that? In any case, I agree that the script should not emit a warning if the default config file doesn't exist, as snmpd will keep going in that case.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=9364edfdf092ee1edc0401518e89d0340ef535ca commit 9364edfdf092ee1edc0401518e89d0340ef535ca Author: Ryan Steinmetz <zi@FreeBSD.org> AuthorDate: 2024-07-19 18:03:04 +0000 Commit: Ryan Steinmetz <zi@FreeBSD.org> CommitDate: 2024-07-19 18:04:28 +0000 net-mgmt/net-snmp: Fix scenario where a user does not have a config in the default location PR: 280284 Reported by: gebhart@secnetix.de net-mgmt/net-snmp/Makefile | 2 +- net-mgmt/net-snmp/files/snmpd.in | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-)
Fixed.