Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 532314 - net-analyzer/icinga2-2.2.1-r1 - critical/icinga-app: Error while parsing command-line options: unrecognised option '-c'
Summary: net-analyzer/icinga2-2.2.1-r1 - critical/icinga-app: Error while parsing comm...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Matthew Thode ( prometheanfire )
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-11 20:00 UTC by Gary E. Miller
Modified: 2014-12-12 18:51 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gary E. Miller 2014-12-11 20:00:05 UTC
The new /etc/init.d/icinga2 is broken.  It will no longer start/stop the daemon.

Reproducible: Always

Steps to Reproduce:
1. rc-service icinga2 restart

Actual Results:  
spidey ~ # rc-service icinga2 restart
 * Caching service dependencies ...                                        [ ok ]
 * Stopping icinga2 ...                                                    [ ok ]
 * Starting icinga2 ...
 * Error starting icinga2. '/var/log/icinga2/startup.log' for details.     [ !! ]
 * ERROR: icinga2 failed to start
spidey ~ # cat /var/log/icinga2/startup.log
[2014-12-11 11:54:39 -0800] critical/icinga-app: Error while parsing command-line options: unrecognised option '-c'
spidey ~ # 


Expected Results:  
spidey ~ # rc-service icinga2 restart
 * Stopping icinga2 ...                                                    [ ok ]
 * Starting icinga2 ...                                                    [ ok ]
spidey ~ # 


The command line to /usr/sbin/icinga2 has changed recently.

I can restart the daemon if I change this:

to this:

ICINGA2_DAEMON_ARGS="
-c $ICINGA2_CONFIG_FILE \
-e $ICINGA2_ERROR_LOG \
-u $ICINGA2_USER \
-g $ICINGA2_GROUP \
-d
"

ICINGA2_DAEMON_ARGS="
daemon
-c $ICINGA2_CONFIG_FILE \
-e $ICINGA2_ERROR_LOG \
-d
"

I know that is an incomplete solution, but icinga2 no longer seems to take user or group on the commmand line.
Comment 1 Gary E. Miller 2014-12-11 20:13:23 UTC
Digging a bit further, I see icinga2 now takes the user:group to run as from the file /etc/icinga2/init.conf:

spidey ~ # cat init.conf
/**
 * This file is read by Icinga 2 before the main
 * configuration file (icinga2.conf) is processed.
 */

const RunAsUser = "icinga"
const RunAsGroup = "icingacmd"
spidey ~ #

So at least the daemon is not running as root.  But these two lines in /etc/conf.d/icinga2 do nothing:

ICINGA2_USER=icinga
ICINGA2_GROUP=icingacmd

I tried this:

ICINGA2_DAEMON_ARGS="
daemon \
-c $ICINGA2_CONFIG_FILE \
-e $ICINGA2_ERROR_LOG \
-D RunAsUser=$ICINGA2_USER \
-D RunAsGroup=$ICINGA2_GROUP \
-d
"

But I get the error:

std::exception::what: Tried to modify read-only script variable 'RunAsUser'


So there may be no way to get $ICINGA2_USER and $ICINGA2_GROUP to run from the command line.
Comment 2 Vladimir Datsevich 2014-12-11 22:06:53 UTC
There is an error in the init script:

The genoo-init script tries to start icinga2 without the daemon option.

Compare to the orogonal init script of icinga:

$DAEMON daemon -c $ICINGA2_CONFIG_FILE -d -e $ICINGA2_ERROR_LOG
Comment 3 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2014-12-12 16:51:08 UTC
Fixed in tree, but will require a remerge.
Comment 4 Dustin Funk 2014-12-12 18:51:39 UTC
(In reply to Matthew Thode ( prometheanfire ) from comment #3)
> Fixed in tree, but will require a remerge.

Thank you! It works!