Installed net-mgmt/nrpe 4.1.0 pkg. Using /usr/local/etc/nrpe.cfg.sample as a template for the running nrpe.cfg gives this pidfile setting: pid_file=/var/nrpe.pid With the included rc.d/nrpe startup script this results in /var/ directory getting chown'd to the nagios user. Presumably it happens due to this command in rc.d/nrpe nrpe_prestart() install -d -o ${nrpe_user:-nagios} ${pidfile%/*} Which results in: $ ls -lad /var drwxr-xr-x 26 nagios wheel 1024 Mar 14 11:39 var $ ls -la /var/nrpe.pid -rw-r--r-- 1 root wheel 5 Mar 14 11:39 /var/nrpe.pid The /var/ ownership change seems bad, and the pidfile location may not be optimal. A couple ideas for a fix: 1) comment-out pid_file from nrpe.cfg and let rc.d/nrpe pidfile logic choose the location 2) set a different path for pid_file in nrpe.cfg, e.g. /var/run/nrpe/nrpe.pid I'm presently using option #1 and it does avoid the /var/ ownership change.
Created attachment 251079 [details] Proposed patch
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=6eec36c45b04c6d437453378dac08171775b2825 commit 6eec36c45b04c6d437453378dac08171775b2825 Author: Muhammad Moinur Rahman <bofh@FreeBSD.org> AuthorDate: 2024-07-28 17:08:53 +0000 Commit: Muhammad Moinur Rahman <bofh@FreeBSD.org> CommitDate: 2024-07-28 17:08:53 +0000 net-mgmt/nrpe: Fix permission on /var - Fix build for ports users [1] PR: 277704, 280180 [1] Reported by: sr@genyosha.net, eugen [1] net-mgmt/nrpe/Makefile | 8 +++++--- net-mgmt/nrpe/pkg-plist | 1 - 2 files changed, 5 insertions(+), 4 deletions(-)
Sorry that I missed the patch and forgot to use your name as the author.