net-analyzer/nagios-core: move localstatedir to /var/lib/nagios.
authorMichael Orlitzky <mjo@gentoo.org>
Sat, 31 Aug 2019 20:23:00 +0000 (16:23 -0400)
committerMichael Orlitzky <mjo@gentoo.org>
Sat, 31 Aug 2019 21:34:55 +0000 (17:34 -0400)
For whatever reason, the local state directory for nagios was
historically set to /var/nagios. The FHS (v3) states that local
application state should live under /var/lib instead, so this revision
sets it to /var/lib/nagios.

This could potentially be annoying to upgraders but is probably non-
fatal. The state directory holds logs and service status information
that can be regenerated if necessary. Doing so could lead to "extra"
service notifications, though. To mitigate this, a warning is emitted
telling upgraders how to migrate the state information if they choose
to do so.

Package-Manager: Portage-2.3.69, Repoman-2.3.16
Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
net-analyzer/nagios-core/nagios-core-4.4.5-r2.ebuild [moved from net-analyzer/nagios-core/nagios-core-4.4.5-r1.ebuild with 91% similarity]

similarity index 91%
rename from net-analyzer/nagios-core/nagios-core-4.4.5-r1.ebuild
rename to net-analyzer/nagios-core/nagios-core-4.4.5-r2.ebuild
index fdfccca6aabe37b78ce60ce045f8e619fbc0e550..2fab4595e6565549ce21c3ed599036e53ca62d65 100644 (file)
@@ -96,7 +96,7 @@ src_configure() {
        econf ${myconf} \
                --prefix=/usr \
                --bindir=/usr/sbin \
-               --localstatedir=/var/nagios \
+               --localstatedir=/var/lib/nagios \
                --sysconfdir=/etc/nagios \
                --libexecdir=/usr/$(get_libdir)/nagios/plugins \
                --with-cgibindir=/usr/$(get_libdir)/nagios/cgi-bin \
@@ -210,4 +210,17 @@ pkg_postinst() {
        elog "filesystem. You can fix this by adding nagios into"
        elog "the group wheel, but this is not recomended."
        elog
+
+       if [ -n "${REPLACING_VERSIONS}" ]; then
+               ewarn "The local state directory for nagios has changed in v4.4.5,"
+               ewarn "from ${EROOT}var/nagios to ${EROOT}var/lib/nagios. If you"
+               ewarn "wish to migrate your state to the new location, first stop"
+               ewarn "nagios and then run"
+               ewarn ""
+               ewarn "  diff --recursive --brief ${EROOT}var/nagios ${EROOT}var/lib/nagios"
+               ewarn ""
+               ewarn "to identify any files that should be moved to the new"
+               ewarn "location. They can simply be moved with \"mv\" before"
+               ewarn "restarting nagios."
+       fi
 }