Fwd: [packages/nagios] fix $HOME env var

Elan Ruusamäe glen at pld-linux.org
Thu Apr 23 14:54:23 CEST 2015

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 <glen at pld-linux.org>
Reply-To: 	pld-devel-en at lists.pld-linux.org, 
pld-devel-pl at lists.pld-linux.org
To: 	pld-cvs-commit at lists.pld-linux.org

commit 72682420b4037546e22f06ed3a32242cac375ef0
Author: Elan Ruusamäe <glen at 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
+# value to use for $HOME
+# as pld initscript resets HOME=/tmp, plugins may inherit bad value
  # 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
  	if [ $RETVAL -eq 0 ]; then
  		touch /var/lock/subsys/nagios

---- gitweb:


pld-cvs-commit mailing list
pld-cvs-commit at lists.pld-linux.org

More information about the pld-devel-en mailing list