Initscript chown to user nagios hardcoded regardless of configuration
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nagios-nrpe (Debian) |
Fix Released
|
Unknown
|
|||
nagios-nrpe (Ubuntu) |
Invalid
|
Wishlist
|
Unassigned |
Bug Description
When setting nagios-nrpe-server to run under any user that is not nagios, the initscript creates a conflict since it has a chown command hardcoded to
user nagios which is the default in the package.
The in the init script as per the package included in ubuntu precise:
*** 43,47 ****
#since /var/run can be wiped completly we create our run directory here
if [ ! -d "$PIDDIR" ]; then
mkdir "$PIDDIR"
chown nagios "$PIDDIR"
fi
---
In my nrpe_local.cfg configuration I have nagios set to run as a custom user:
nrpe_user=
nrpe_group=
Hence when I restart the server the upstart script will leave the permissions messed up and the service will fail to start properly.
IMHO the initscript should either not try to chown the piddir at all, or at least parse this setting from /etc/default or any other config,
but the way the package is right now makes unpractical or simply impossible to run the service reliably unless with the default "nagios" user.
In my cluster I did add this setting as a variable in the header of the initscript. Ideally it should be parsed through the relevant /etc/default file.
-----
NAGIOS_
[...]
chown "$NAGIOS_USER" "$PIDDIR"
-----
Cheers,
-kali-
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: nagios-nrpe-server 2.12-5ubuntu1.2
ProcVersionSign
Uname: Linux 3.5.0-51-generic x86_64
NonfreeKernelMo
ApportVersion: 2.0.1-0ubuntu17.6
Architecture: amd64
Date: Wed Jul 2 10:47:15 2014
InstallationMedia: Ubuntu 12.04.2 LTS "Precise Pangolin" - Release amd64 (20130213)
MarkForUpload: True
ProcEnviron:
TERM=xterm
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: nagios-nrpe
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in nagios-nrpe (Debian): | |
status: | Unknown → Fix Released |
Thank you for taking the time to report this bug and helping to make Ubuntu better.
> IMHO the initscript should either not try to chown the piddir at all, or at least parse this setting from /etc/default or any other config,
I agree that this would be nice.
> ...but the way the package is right now makes unpractical or simply impossible to run the service reliably unless with the default "nagios" user.
Can you not just modify the initscript, given that you're modifying the default configuration manually already? It's a conffile - the package manager will honour your changes, with the only disadvantage being that if the packaged initscript changes on upgrade, you'll be prompted to resolve the conflict manually.
As I believe there's an easy workaround available, I think this is of Wishlist importance.
I also suggest that you check what Debian does, file a bug there if has the same behaviour and a bug isn't already filed, etc. As Ubuntu's packaging is based on the Debian one, we would prefer changes to come from Debian where relevant.