User and group are hard coded in the init script

Bug #1186550 reported by Sebastian Kirsch
10
This bug affects 1 person
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_user="$(get_config icinga_user)"
- nagios_group="$(get_config icinga_group)"
+ icinga_user="$(get_config icinga_user)"
+ icinga_group="$(get_config icinga_group)"
     log_file="$(get_config log_file)"
     log_dir="$(dirname $log_file)"

@@ -123,7 +123,7 @@
 start () {
   DIRECTORY=$(dirname $THEPIDFILE)
   [ ! -d $DIRECTORY ] && mkdir -p $DIRECTORY
- chown nagios:nagios $DIRECTORY
+ chown $icinga_user:$icinga_group $DIRECTORY

   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/i/icinga/icinga-common_1.6.1-2_all.deb
Size: 65268
MD5sum: 12b76eb3f7d40715acc7d380296042e5
SHA1: 6246778063486a0d69f0581edee6cd848e966484
SHA256: 56c50ada8e64134511b4f6322c4a95129e975b03c6481ae3f16ebc44782d7f24

Tags: patch precise
Revision history for this message
papukaija (papukaija) wrote :

Thank you for your report and making Ubuntu better. I copied your proposed fix into patch. Thanks

tags: added: precise
tags: added: patch
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "icinga.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

Revision history for this message
Alexander Wirt (formorer) wrote :

JTFR I (the debian Maintainer) will never support changing the user icinga is running under. Any patch will therefore be ubuntu specfic.

Revision history for this message
Sebastian Kirsch (kirsch-seb) wrote :

Thanks for your answers.

@formorer:
Can you please explain the reason for never changing the user icinga is running as? I will not discuss your decision here. But I'm just interested in that. Perhabs I did something wrong if I want change the user.

Revision history for this message
Alexander Wirt (formorer) wrote :

Every nagios related component is configured to run as nagios:nagios, in that way running them on Nagios and Icinga is possible without much problems and we don't have to adapt any documentation for complicated setup steps. Just changing the user for icinga isn't enough, there have to be several changes on directory permissions too. So in short: its perfect the way it is and supporting installations that are not running under nagios:nagios isn't wanted - and if you ask me - its not neccessary. I / we invested a lot of work to take sure that installing Icinga (and a related stuff) is as easy as possible.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.