]> git.pld-linux.org Git - packages/nagios.git/commitdiff
use /var/lib/nagios as nagios $HOME nagios-3.2
authorElan Ruusamäe <glen@delfi.ee>
Thu, 7 May 2015 19:32:50 +0000 (22:32 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Fri, 7 Aug 2015 13:17:16 +0000 (16:17 +0300)
Conflicts:
nagios.spec

nagios.init
nagios.spec

index 20988bb083895743f115c73448961c8cbedad03b..28e3874b3c12dd343778502deea1fb8afc3d8921 100644 (file)
@@ -29,7 +29,7 @@ cfg_file=/etc/nagios/nagios.cfg
 
 # value to use for $HOME
 # as pld initscript resets HOME=/tmp, plugins may inherit bad value
-nagios_home=/usr/lib/nagios
+nagios_home=/var/lib/nagios
 
 # check for precache
 precached_object_file=$(awk -F= '/^precached_object_file/{print $2}' $cfg_file)
index a784dc9baa7565b614b62eabade9b766b65d9654..83e0de26a59b05380cbfca035702aa256aa66bdc 100644 (file)
@@ -11,7 +11,7 @@ Summary(pl.UTF-8):    Program do monitorowania serwerów/usług/sieci
 Summary(pt_BR.UTF-8):  Programa para monitoração de máquinas e serviços
 Name:          nagios
 Version:       3.2.3
-Release:       5
+Release:       6
 License:       GPL v2+
 Group:         Networking
 Source0:       http://downloads.sourceforge.net/nagios/%{name}-%{version}.tar.gz
@@ -63,6 +63,7 @@ BuildRoot:    %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 %define                cgidir          %{_libdir}/%{name}/cgi
 %define                htmldir         %{_prefix}/share/%{name}
 %define                _localstatedir  /var/lib/%{name}
+%define                nagioshome      %{_localstatedir}
 %define                _webapps        /etc/webapps
 %define                _webapp         %{name}
 
@@ -343,7 +344,12 @@ fi
 if [ -n "$(id -u netsaint 2>/dev/null)" ] && [ "$(id -u netsaint)" = "72" ]; then
        /usr/sbin/usermod -d %{_libdir}/%{name} -l nagios -c "Nagios Daemon" -G nagcmd netsaint
 fi
-%useradd -u 72 -d %{_libdir}/%{name} -s /bin/false -c "Nagios Daemon" -g nagios -G nagcmd nagios
+%useradd -u 72 -d %{nagioshome} -s /bin/false -c "Nagios Daemon" -g nagios -G nagcmd nagios
+# update nagios user home
+home=$(IFS=:; set -- $(getent passwd nagios); echo $6)
+if [ "$home" != %{nagioshome} ]; then
+       /usr/sbin/usermod -d %{nagioshome} nagios
+fi
 
 %postun common
 if [ "$1" = "0" ]; then
@@ -395,6 +401,14 @@ for a in dependencies.cfg services.cfg serviceextinfo.cfg hosts.cfg hostgroups.c
 done
 %{__sed} -i -e 's,^check_result_path=.*,check_result_path=%{_var}/spool/%{name}/checkresults,' %{_sysconfdir}/%{name}.cfg
 
+
+%triggerpostun -- nagios-common < 3.2.3-6
+%banner -e %{name}-common <<EOF
+
+IMPORTANT: nagios user home changed to %{nagioshome}, you may need to move files from previous location %{_libdir}/%{name}.
+
+EOF
+
 %files
 %defattr(644,root,root,755)
 %doc Changelog README* UPGRADING INSTALLING LICENSE
This page took 0.15634 seconds and 4 git commands to generate.