User and group are hard coded in the init script
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
icinga (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Hi folks,
if you change the user and group of the icinga process in the icinga.cfg file, there is an error message during restart:
root@monitoring:~# LC_ALL=C /etc/init.d/icinga restart
* Restarting icinga monitoring daemon icinga
chown: invalid user: `nagios:nagios'
The problem is the hard coded user and group in the init script, in line 126:
start () {
...
chown nagios:nagios $DIRECTORY
...
}
That's why I would suggest following changes in the init script:
--- icinga 2012-01-16 07:42:34.000000000 +0100
+++ icinga-new 2013-06-01 14:55:10.545363714 +0200
@@ -89,8 +89,8 @@
check_config () {
if $DAEMON -v $ICINGACFG >/dev/null 2>&1 ; then
# First get the user/group etc Icinga is running as
- nagios_
- nagios_
+ icinga_
+ icinga_
log_
log_
@@ -123,7 +123,7 @@
start () {
DIRECTORY=
[ ! -d $DIRECTORY ] && mkdir -p $DIRECTORY
- chown nagios:nagios $DIRECTORY
+ chown $icinga_
if ! check_started; then
if ! check_named_pipe; then
Thanks and kind regards,
Sebastian
System information:
-------
Ubuntu 12.04.2 LTS
Linux monitoring 3.2.0-45-generic #70-Ubuntu SMP Wed May 29 20:12:06 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
Package information:
-------
Filename: pool/universe/
Size: 65268
MD5sum: 12b76eb3f7d4071
SHA1: 6246778063486a0
SHA256: 56c50ada8e64134
Thank you for your report and making Ubuntu better. I copied your proposed fix into patch. Thanks