You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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:
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.
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:
However, all of those paths are relative to the directories that are passed to nagios's ./configure script. For example, we pass
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
The text was updated successfully, but these errors were encountered: