Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 534068 - net-analyzer/icinga2 - /etc/init.d/icinga2 fails to write to /run/icinga2/icinga2/icinga2.pid
Summary: net-analyzer/icinga2 - /etc/init.d/icinga2 fails to write to /run/icinga2/ici...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Matthew Thode ( prometheanfire )
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-31 07:09 UTC by Reuben Farrelly
Modified: 2015-01-13 04:42 UTC (History)
0 users

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 Reuben Farrelly 2014-12-31 07:09:13 UTC
There are multiple problems with the existing init script currently shipped for icinga2:

1. The existing script starts with these defines at the top:

ICINGA2_CONFIG_FILE="/etc/icinga2/icinga2.conf"
ICINGA2_RUN_DIR="/run/icinga2"
ICINGA2_STATE_DIR="/var/cache/icinga2"
ICINGA2_CMD_DIR="${ICINGA2_RUN_DIR}/cmd"
ICINGA2_PID_FILE="${ICINGA2_RUN_DIR}/icinga2/icinga2.pid"
ICINGA2_DAEMON_ARGS="daemon -c $ICINGA2_CONFIG_FILE -e $ICINGA2_ERROR_LOG -d"

There is an error with the ICINGA2_PID_FILE define.  This expands to ICINGA2_PID_FILE misdefined as '/run/icinga2/icinga2/icinga2.pid - which is invalid.  This define is used in all of the init script sections - start, stop and status.

Fixing this define fixes the issue whereby /etc/init.d/icinga2 stop doesn't work at all (ie the stop command is completely broken right now).


2. With the above error corrected, the output of '/etc/init.d/icinga2 status' is:

tornado files # /etc/init.d/icinga2 status                                                                                [ ok ]
tornado files # 

The correct output for this command is:

tornado files # /etc/init.d/icinga2 status
 * status: started
tornado files # 

Simply removing the entire "status()" section of the init file seems to fix this bug also, as the status command then works as expected, and produces the right output.

3. The init script shipped with icinga2 supports a 'configcheck' option.  We should support this in the Gentoo version too.

The upstream initscript looks like this:

https://github.com/Icinga/icinga2/blob/master/etc/initsystem/icinga2.init.d.cmake

Perhaps something from their version can be re-used in our version.
Comment 1 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2015-01-13 04:42:50 UTC
thanks for pointing those out :D fixed