Bug 277704 - net-mgmt/nrpe changes /var/ ownership to nagios when rc.d/nrpe starts
Summary: net-mgmt/nrpe changes /var/ ownership to nagios when rc.d/nrpe starts
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Muhammad Moinur Rahman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-14 19:54 UTC by Steve Rikli
Modified: 2024-03-14 19:54 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (bofh)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steve Rikli 2024-03-14 19:54:30 UTC
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.