diff --git a/Anvil/Tools.pm b/Anvil/Tools.pm index 4dbd25fb..c2f0b067 100644 --- a/Anvil/Tools.pm +++ b/Anvil/Tools.pm @@ -1254,7 +1254,7 @@ sub _set_paths pamscale => "/usr/bin/pamscale", pamtopng => "/usr/bin/pamtopng", passwd => "/usr/bin/passwd", - pcs => "/usr/sbin/pcs", + pcs => "/usr/sbin/anvil-pcs-wrapper", perccli64 => "/opt/MegaRAID/perccli/perccli64", pidof => "/usr/sbin/pidof", ping => "/usr/bin/ping", diff --git a/tools/Makefile.am b/tools/Makefile.am index ee9dd223..a2192d4d 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -28,6 +28,7 @@ dist_sbin_SCRIPTS = \ anvil-migrate-server \ anvil-network-profiler \ anvil-parse-fence-agents \ + anvil-pcs-wrapper \ anvil-provision-server \ anvil-rename-server \ anvil-report-usage \ diff --git a/tools/anvil-pcs-wrapper b/tools/anvil-pcs-wrapper new file mode 100755 index 00000000..d42770c8 --- /dev/null +++ b/tools/anvil-pcs-wrapper @@ -0,0 +1,10 @@ +#!/bin/sh -e + +( + if [ "$1" != "constraint" ]; then + pcs $@ + exit $? + fi + flock -e 200 + pcs $@ +) 200>/tmp/pcs.lock