]> git.pld-linux.org Git - packages/nagios.git/commitdiff
fix $HOME env var
authorElan Ruusamäe <glen@delfi.ee>
Thu, 23 Apr 2015 12:51:26 +0000 (15:51 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Thu, 23 Apr 2015 12:51:26 +0000 (15:51 +0300)
nagios.init

index cf6348fe321c1df7e23f4a7434806e790030e616..b23587e6bd3c1c71d282cbf5a8b4530c4db3161e 100755 (executable)
@@ -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
This page took 0.031923 seconds and 4 git commands to generate.