
florian.haas at linbit
Jun 22, 2009, 3:17 AM
Views: 316
Permalink
|
|
[PATCH] have_binary helper function: explicitly redirect stderr from which to /dev/null
|
|
# HG changeset patch # User Florian Haas <florian.haas[at]linbit.com> # Date 1245665801 -7200 # Node ID fafbd221464648c5444de6bd26ff3bb5bb677bc0 # Parent 2aa649cdb8d3d3e35165a47fda8cbd47dc61d9ff have_binary helper function: explicitly redirect stderr from which to /dev/null Some incarnations of which will output "/usr/bin/which: no <foo> in ($PATH)" on stderr, which will show up in the logs as output from the RA. This is specifically the case if which is aliased as suggested in its man page. Explicitly redirecting stderr to /dev/null within the backticks will remove this minor nuisance. diff -r 2aa649cdb8d3 -r fafbd2214646 resources/OCF/.ocf-binaries.in --- a/resources/OCF/.ocf-binaries.in Mon Jun 22 11:45:16 2009 +0200 +++ b/resources/OCF/.ocf-binaries.in Mon Jun 22 12:16:41 2009 +0200 @@ -71,7 +71,7 @@ have_binary () { bin=`echo $1 | sed -e 's/ -.*//'` - if [ -x "`which $bin`" ] >/dev/null 2>&1 ; then + if [ -x "`which $bin 2>/dev/null`" ] >/dev/null 2>&1 ; then return 0 fi return 1 _______________________________________________________ Linux-HA-Dev: Linux-HA-Dev[at]lists.linux-ha.org http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev Home Page: http://linux-ha.org/
|