[Bug 1336687] [NEW] Initscript chown to user nagios hardcoded regardless of configuration
kali
drinkkali at gmail.com
Wed Jul 2 08:49:00 UTC 2014
Public bug reported:
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=srv-monitor
nrpe_group=srv-monitor
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_USER=srv-monitor
[...]
chown "$NAGIOS_USER" "$PIDDIR"
-----
Cheers,
-kali-
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: nagios-nrpe-server 2.12-5ubuntu1.2
ProcVersionSignature: Ubuntu 3.5.0-51.77~precise1-generic 3.5.7.33
Uname: Linux 3.5.0-51-generic x86_64
NonfreeKernelModules: nvidia
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)
** Affects: nagios-nrpe (Ubuntu)
Importance: Undecided
Status: New
** Tags: amd64 apport-bug precise
--
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to nagios-nrpe in Ubuntu.
https://bugs.launchpad.net/bugs/1336687
Title:
Initscript chown to user nagios hardcoded regardless of configuration
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nagios-nrpe/+bug/1336687/+subscriptions
More information about the Ubuntu-server-bugs
mailing list