From 7e81910df1947a9b7968fffe52655438b1adbdc4 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Sat, 31 Aug 2019 16:23:00 -0400 Subject: [PATCH] net-analyzer/nagios-core: move localstatedir to /var/lib/nagios. 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 --- ....4.5-r1.ebuild => nagios-core-4.4.5-r2.ebuild} | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) rename net-analyzer/nagios-core/{nagios-core-4.4.5-r1.ebuild => nagios-core-4.4.5-r2.ebuild} (91%) diff --git a/net-analyzer/nagios-core/nagios-core-4.4.5-r1.ebuild b/net-analyzer/nagios-core/nagios-core-4.4.5-r2.ebuild 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 fdfccca6aabe..2fab4595e656 100644 --- a/net-analyzer/nagios-core/nagios-core-4.4.5-r1.ebuild +++ b/net-analyzer/nagios-core/nagios-core-4.4.5-r2.ebuild @@ -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 } -- 2.26.2