Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide support for Gentoo using OpenRC init scripts #378

Closed
box293 opened this issue Jun 2, 2017 · 4 comments
Closed

Provide support for Gentoo using OpenRC init scripts #378

box293 opened this issue Jun 2, 2017 · 4 comments
Assignees
Milestone

Comments

@box293
Copy link
Contributor

box293 commented Jun 2, 2017

I was creating documentation on installing Nagios Core from source on Gentoo and came across the issue where Gentoo uses OpenRC for their init scripts. This is a request to include support for Gentoo OpenRC when Nagios Core is compiled.

I currently have instructions here that will download an OpenRC init script from the Gentoo git and will modify the paths in the script for it to work:

https://support.nagios.com/kb/article/nagios-core-installing-nagios-core-from-source.html#Gentoo

While speaking to the package maintainer for Nagios Core on Gentoo they gave me the following information/advice/request:


Since we install a fixed script AFTER nagios is built, we've hard-coded a few things:
  • command="/usr/sbin/nagios"
  • pidfile="/var/nagios/nagios.lock"
  • HOME=/var/nagios/home
  • nagios_config="/etc/nagios/nagios.cfg"

However, all of those paths are relative to the directories that are passed to nagios's ./configure script. For example, we pass

./configure --sysconfdir=/etc/nagios

so that "/etc/nagios/nagios.cfg" is really nothing but @SYSCONFDIR@/nagios.cfg. The right way for you to do it would be to put those variables (e.g. @SYSCONFDIR@) in the init script, rename it to something like "nagios.init.in", and tell autotools to make the appropriate substitutions. That way, no matter what paths the user decides on, the init script always points to the right places.

You can see an example of this approach in PHP's init script:

https://github.com/php/php-src/blob/master/sapi/fpm/init.d.php-fpm.in

We would be able to use the upstream init script in that case, so this would benefit us as well.


It would also be nice to provide credit to the Gentoo package maintainers for their OpenRC script:

https://packages.gentoo.org/packages/net-analyzer/nagios

@jfrickson jfrickson added this to the 5.0.0 milestone Jun 2, 2017
@jfrickson
Copy link
Contributor

Thanks, @box293

@hedenface hedenface self-assigned this Jun 18, 2017
@orlitzky
Copy link
Contributor

orlitzky commented Aug 2, 2017

I'm that maintainer and I'm willing to help on this. There's one more autoconf change needed to complete issue #404, and then I'll update the init script that we use in Gentoo. At that point, all that needs to be done is to replace a few hard-coded paths with @variable@s, add it to the nagios repo, and make autotools do the substitutions.

@orlitzky
Copy link
Contributor

orlitzky commented Aug 4, 2017

Here's a tentative branch:

https://github.com/orlitzky/nagioscore/tree/openrc-init

It's supposed to rain tonight, so maybe I'll be forced to stay in and finish it up.

@hedenface hedenface modified the milestones: 5.0.0, 4.4.0 Jun 2, 2018
@hedenface
Copy link
Contributor

This was added in #407

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants