imho we should set nagios user $HOME to be /var/lib/nagios

currently it's /usr/lib/nagios on i686 and /usr/lib64/nagios on x86_64

it's first inconsistent (can't share configs)
and secondly some plugins require putting files to $HOME, and writing to /usr/lib/nagios by sysadmin/apps is wrong.


-------- Original Message --------
Subject:        [packages/nagios] fix $HOME env var
Date:   Thu, 23 Apr 2015 14:51:41 +0200
From:   glen <g...@pld-linux.org>
Reply-To: pld-devel-en@lists.pld-linux.org, pld-devel...@lists.pld-linux.org
To:     pld-cvs-com...@lists.pld-linux.org



commit 72682420b4037546e22f06ed3a32242cac375ef0
Author: Elan Ruusamäe <g...@delfi.ee>
Date:   Thu Apr 23 15:51:26 2015 +0300

    fix $HOME env var

 nagios.init | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/nagios.init b/nagios.init
index cf6348f..b23587e 100755
--- a/nagios.init
+++ b/nagios.init
@@ -27,6 +27,10 @@ fi
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
+
 # check for precache
 precached_object_file=$(awk -F= '/^precached_object_file/{print $2}' $cfg_file)
@@ -83,7 +87,7 @@ start() { # we're safe to use -x as we did verify config prior startup
        # precached object file also is created in configtest.
-       daemon /usr/sbin/nagios ${precached_object_file:+-u} -x -d $cfg_file
+       daemon env -i PATH="$PATH" HOME="$nagios_home" /usr/sbin/nagios 
${precached_object_file:+-u} -x -d $cfg_file
        RETVAL=$?
        if [ $RETVAL -eq 0 ]; then
                touch /var/lock/subsys/nagios
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/nagios.git/commitdiff/72682420b4037546e22f06ed3a32242cac375ef0

_______________________________________________
pld-cvs-commit mailing list
pld-cvs-com...@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit



_______________________________________________
pld-devel-en mailing list
pld-devel-en@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-devel-en

Reply via email to