[Bug 1186550] Re: User and group are hard coded in the init script

2013-06-03 Thread Sebastian Kirsch
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.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1186550

Title:
  User and group are hard coded in the init script

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/icinga/+bug/1186550/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1186550] [NEW] User and group are hard coded in the init script

2013-06-01 Thread Sebastian Kirsch
Public bug reported:

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.0 +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

** Affects: icinga (Ubuntu)
 Importance: Undecided
 Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1186550

Title:
  User and group are hard coded in the init script

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/icinga/+bug/1186550/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs