Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 532582 - net-analyzer/icinga2-2.2.1-r1 regression: start does not check the config or create required folders
Summary: net-analyzer/icinga2-2.2.1-r1 regression: start does not check the config or ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Matthew Thode ( prometheanfire )
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-14 19:12 UTC by Vincent Brillault
Modified: 2014-12-14 23:33 UTC (History)
0 users

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


Attachments
New init script for icinga 2 (icinga2.initd,2.13 KB, text/plain)
2014-12-14 19:12 UTC, Vincent Brillault
Details
New init script for icinga 2 (icinga2.initd,1.97 KB, text/plain)
2014-12-14 22:35 UTC, Vincent Brillault
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vincent Brillault 2014-12-14 19:12:36 UTC
Created attachment 391728 [details]
New init script for icinga 2

With the new initscript introduced, part of the existing functionalities were lost. I've attached a new init script with the following modifications:
- Calls to checkpath to replace the missing icinga2-prepare-dirs (required to create /run/icinga2 and /var/cache/icinga2)
- Call to icinga2 daemon in '-C' mode, which checks the configuration (but was missing in the current runscript)
- extra_commands="checkconfig"
- Start failure on configuration failure
- Use start-stop-daemon for starting the daemon
- Use the standard status command, no need to recreate one

There are still some issues:
- "checkpath -d -m 2750" does not seem to work: "/run/icinga2/cmd: correcting mode" on every start
- It would be great to have a dependency on postgres/mysql depending on the useflags: any idea how to do so?
- Is "need net" required?

(Warning: I'm not runscript expert, so there might be errors in there)
Comment 1 Vincent Brillault 2014-12-14 22:35:33 UTC
Created attachment 391744 [details]
New init script for icinga 2

As prometheanfire noticed on IRC, I missed that ICINGA2_USER is not defined anymore in the conf file (I was using a staled version).

This new version uses $DAEMON variable get --current RunAsUser/RunAsGroup to get the running user/group first (and doesn't try anymore to compare it to a non existant value in the conf filr)
Comment 2 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2014-12-14 23:33:44 UTC
thanks for working on this, fixed in tree as r2

I think the 2750 issue is a common one.

Don't think we should depend on pgsql/mysql (maybe a use postgresql/mysql would work).  You may be connecting to a remote pgsql server (as I am).  Also, for pgsql, the initscripts are based on version installed, so it'd be postgresql-server-9.3 or something.

I think need net is still required though, this is in 'net-analyzer' for a reason.