Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 245007

Summary: net-analyzer/centreon - centreon init script causes ods to start as root
Product: Gentoo Linux Reporter: Jeff Mills <hybiepoo>
Component: New packagesAssignee: Gentoo Web Application Packages Maintainers <web-apps>
Status: RESOLVED CANTFIX    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Jeff Mills 2008-10-30 21:56:31 UTC
When centreon is installed, the syntax in the init script is wrong, which causes ods to start as root instead of the nagios user. This causes the performance data files to be recreated as the root user and the nagios user can no longer write to the files.

Reproducible: Always

Steps to Reproduce:
1. Install centreon
2. /etc/init.d/ods start
3. ps axu |grep ods

Actual Results:  
ods is running as root user

Expected Results:  
ods should be running as nagios user
Comment 1 Jeff Mills 2008-10-30 21:59:04 UTC
Here is a change to the init script that makes ods run as the nagios user.

#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-analyzer/centreon/files/ods.initd,v 1.1 2008/03/28 18:38:07 hollow Exp $

depend() {
        need mysql
}

start() {
        ebegin "Starting OreonDataStorage (ODS)"
        start-stop-daemon --start --pidfile /var/run/ods/ods.pid \
                --chuid nagios \
                --background \
                --exec /usr/sbin/ods \
                --group nagios
        eend
}

stop() {
        ebegin "Stopping OreonDataStorage (ODS)"
        start-stop-daemon  --stop --pidfile /var/run/ods/ods.pid \
        --user nagios
        eend
}
Comment 2 Benedikt Böhm (RETIRED) gentoo-dev 2008-11-18 09:58:48 UTC
from the s-s-d help text:
  -c, --chuid <arg>                 deprecated, use --user
Comment 3 Jeff Mills 2008-11-18 20:24:30 UTC
(In reply to comment #2)
> from the s-s-d help text:
>   -c, --chuid <arg>                 deprecated, use --user
> 

Interesting!
Perhaps there is some other issue with the ods init script then, because it definitely starts ods as the root user. It caused me many headaches before I realised what was going on.

start-stop-daemon --help shows this:

-c|--chuid <name|uid[:group|gid]>
                change to this user/group before starting process
  -u|--user <username>|<uid>    stop processes owned by this user

To me, this tells me that --user is used to "stop processes owned by this user", not to start the process as this user!
Comment 4 Agostino Sarubbo gentoo-dev 2011-10-11 14:15:18 UTC
Closing as CANTFIX, the package is not any more in the main tree.