[Bug 277704] net-mgmt/nrpe changes /var/ ownership to nagios when rc.d/nrpe starts

From: <bugzilla-noreply_at_freebsd.org>
Date: Thu, 14 Mar 2024 19:54:30 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277704

            Bug ID: 277704
           Summary: net-mgmt/nrpe changes /var/ ownership to nagios when
                    rc.d/nrpe starts
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: bofh@freebsd.org
          Reporter: sr@genyosha.net
             Flags: maintainer-feedback?(bofh@freebsd.org)
          Assignee: bofh@freebsd.org

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.